void0028 commited on
Commit
cb10a1d
·
verified ·
1 Parent(s): 37b70ed

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -14
Dockerfile CHANGED
@@ -22,50 +22,48 @@ ENV CASTING_DISABLED=1
22
  ENV STREAMING_DISABLED=0
23
  ENV PORT=11470
24
 
25
- # 5. The "Scavenger" Proxy Script
26
- # Just a simple proxy that also serves a status page so you know it's working.
27
  RUN echo "const http = require('http'); \
28
  const httpProxy = require('http-proxy'); \
29
  const proxy = httpProxy.createProxyServer({}); \
30
  const STREMIO_TARGET = 'http://127.0.0.1:11470'; \
31
  \
32
  proxy.on('error', function (err, req, res) { \
33
- res.writeHead(500); res.end('Engine booting...'); \
34
  }); \
35
  \
36
  const server = http.createServer((req, res) => { \
37
  if (req.url === '/') { \
38
  res.writeHead(200, {'Content-Type': 'text/html'}); \
39
- res.end('<h1 style=\"color:orange;text-align:center;font-family:monospace;margin-top:20%\">✅ SCAVENGER MODE ACTIVE <br> ⚡ 500 PEERS | 10GB RAM</h1>'); \
40
  } else { \
41
  proxy.web(req, res, { target: STREMIO_TARGET }); \
42
  } \
43
  }); \
44
  server.listen(7860, '0.0.0.0');" > /stremio/proxy.js
45
 
46
- # 6. The Startup Logic (The Important Part)
47
  RUN echo "#!/bin/bash \n\
48
  \n\
49
  # --- RAM CHECK --- \n\
50
- # We check if we can steal 10GB of RAM for cache. \n\
51
  SHM_SIZE=\$(df -B1 /dev/shm | awk 'NR==2 {print \$2}') \n\
52
  REQUIRED=10737418240 \n\
53
  \n\
54
  if [ \"\$SHM_SIZE\" -ge \"\$REQUIRED\" ]; then \n\
55
  CACHE_ROOT=\"/dev/shm\" \n\
56
- echo \"🔥 RAM MODE: Using /dev/shm\" \n\
57
  else \n\
58
  CACHE_ROOT=\"/tmp\" \n\
59
- echo \"⚠️ DISK MODE: Using /tmp (Linux Page Cache will still save you)\" \n\
60
  fi \n\
61
  \n\
62
- # --- SETTINGS EXPLAINED --- \n\
63
- # btMaxConnections: 500 -> The limit of your CPU. \n\
64
- # btHandshakeTimeout: 20000 -> 20s. Gives slow peers a chance to reply (crucial for rare stuff). \n\
65
- # btMinPeersForStable: 50 -> The \"Hungry\" setting. Engine won't stop searching until it finds 50 good peers. \n\
66
- # btDownloadSpeedSoftLimit: 1.6GB/s -> Set insanely high so it never throttles itself. \n\
67
  \n\
68
- echo \"{\\\"cacheSize\\\": 10737418240, \\\"cacheRoot\\\": \\\"\$CACHE_ROOT\\\", \\\"btProfile\\\": \\\"ultra_fast\\\", \\\"btMaxConnections\\\": 500, \\\"connections\\\": 500, \\\"btHandshakeTimeout\\\": 20000, \\\"btRequestTimeout\\\": 4000, \\\"btDownloadSpeedSoftLimit\\\": 1677721600, \\\"btDownloadSpeedLimit\\\": 0, \\\"btMinPeersForStable\\\": 50}\" > /root/.stremio-server/server-settings.json \n\
69
  \n\
70
  # Run \n\
71
  node /stremio/proxy.js & \n\
@@ -75,3 +73,4 @@ EXPOSE 7860
75
  ENTRYPOINT ["/usr/bin/dumb-init", "--"]
76
  CMD ["/stremio/start.sh"]
77
 
 
 
22
  ENV STREAMING_DISABLED=0
23
  ENV PORT=11470
24
 
25
+ # 5. Status Page (So you know it's running)
 
26
  RUN echo "const http = require('http'); \
27
  const httpProxy = require('http-proxy'); \
28
  const proxy = httpProxy.createProxyServer({}); \
29
  const STREMIO_TARGET = 'http://127.0.0.1:11470'; \
30
  \
31
  proxy.on('error', function (err, req, res) { \
32
+ res.writeHead(500); res.end('Booting...'); \
33
  }); \
34
  \
35
  const server = http.createServer((req, res) => { \
36
  if (req.url === '/') { \
37
  res.writeHead(200, {'Content-Type': 'text/html'}); \
38
+ res.end('<h1 style=\"color:magenta;text-align:center;font-family:monospace;margin-top:20%\">🚀 GOD MODE ACTIVE <br> ⚡ 500 CONNS | 100 MIN PEERS | 10GB RAM</h1>'); \
39
  } else { \
40
  proxy.web(req, res, { target: STREMIO_TARGET }); \
41
  } \
42
  }); \
43
  server.listen(7860, '0.0.0.0');" > /stremio/proxy.js
44
 
45
+ # 6. The Startup Logic (10GB Force)
46
  RUN echo "#!/bin/bash \n\
47
  \n\
48
  # --- RAM CHECK --- \n\
49
+ # We check if /dev/shm allows 10GB. \n\
50
  SHM_SIZE=\$(df -B1 /dev/shm | awk 'NR==2 {print \$2}') \n\
51
  REQUIRED=10737418240 \n\
52
  \n\
53
  if [ \"\$SHM_SIZE\" -ge \"\$REQUIRED\" ]; then \n\
54
  CACHE_ROOT=\"/dev/shm\" \n\
55
+ echo \"🔥 RAM MODE: Using /dev/shm (Pure Speed)\" \n\
56
  else \n\
57
  CACHE_ROOT=\"/tmp\" \n\
58
+ echo \"⚠️ DISK MODE: Using /tmp (Linux Page Cache will handle it since you have 18GB RAM)\" \n\
59
  fi \n\
60
  \n\
61
+ # --- FINAL SETTINGS --- \n\
62
+ # cacheSize: 10GB (10737418240 bytes) \n\
63
+ # btMinPeersForStable: 100 (Keeps hunting longer = Better) \n\
64
+ # btMaxConnections: 500 (Max limit) \n\
 
65
  \n\
66
+ echo \"{\\\"cacheSize\\\": 10737418240, \\\"cacheRoot\\\": \\\"\$CACHE_ROOT\\\", \\\"btProfile\\\": \\\"ultra_fast\\\", \\\"btMaxConnections\\\": 500, \\\"connections\\\": 500, \\\"btHandshakeTimeout\\\": 20000, \\\"btRequestTimeout\\\": 4000, \\\"btDownloadSpeedSoftLimit\\\": 1677721600, \\\"btDownloadSpeedLimit\\\": 0, \\\"uploadSpeedLimit\\\": 1048576, \\\"btMinPeersForStable\\\": 100}\" > /root/.stremio-server/server-settings.json \n\
67
  \n\
68
  # Run \n\
69
  node /stremio/proxy.js & \n\
 
73
  ENTRYPOINT ["/usr/bin/dumb-init", "--"]
74
  CMD ["/stremio/start.sh"]
75
 
76
+