void0028 commited on
Commit
3d1cb43
·
verified ·
1 Parent(s): cb10a1d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -23
Dockerfile CHANGED
@@ -10,19 +10,24 @@ RUN apt-get update && \
10
  # 2. Setup Stremio
11
  WORKDIR /stremio
12
  RUN mkdir -p /root/.stremio-server
 
 
 
 
 
13
  RUN wget https://dl.strem.io/four/v4.4.168/server.js -O server.js
14
  RUN wget https://dl.strem.io/four/v4.4.168/stremio.asar -O stremio.asar
15
 
16
- # 3. Install Proxy
17
  RUN npm install http-proxy
18
 
19
- # 4. Envs
20
  ENV NO_CORS=1
21
  ENV CASTING_DISABLED=1
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({}); \
@@ -35,35 +40,25 @@ proxy.on('error', function (err, req, res) { \
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,4 +68,3 @@ EXPOSE 7860
73
  ENTRYPOINT ["/usr/bin/dumb-init", "--"]
74
  CMD ["/stremio/start.sh"]
75
 
76
-
 
10
  # 2. Setup Stremio
11
  WORKDIR /stremio
12
  RUN mkdir -p /root/.stremio-server
13
+
14
+ # 3. Create a SPECIFIC Disk Directory (Not /tmp)
15
+ # This forces it to use the container's overlay storage (Disk)
16
+ RUN mkdir -p /stremio/data
17
+
18
  RUN wget https://dl.strem.io/four/v4.4.168/server.js -O server.js
19
  RUN wget https://dl.strem.io/four/v4.4.168/stremio.asar -O stremio.asar
20
 
21
+ # 4. Install Proxy
22
  RUN npm install http-proxy
23
 
24
+ # 5. Envs
25
  ENV NO_CORS=1
26
  ENV CASTING_DISABLED=1
27
  ENV STREAMING_DISABLED=0
28
  ENV PORT=11470
29
 
30
+ # 6. Status Page
31
  RUN echo "const http = require('http'); \
32
  const httpProxy = require('http-proxy'); \
33
  const proxy = httpProxy.createProxyServer({}); \
 
40
  const server = http.createServer((req, res) => { \
41
  if (req.url === '/') { \
42
  res.writeHead(200, {'Content-Type': 'text/html'}); \
43
+ res.end('<h1 style=\"color:blue;text-align:center;font-family:monospace;margin-top:20%\">💾 REAL DISK MODE <br> ⚡ 25GB CACHE | 500 CONNS</h1>'); \
44
  } else { \
45
  proxy.web(req, res, { target: STREMIO_TARGET }); \
46
  } \
47
  }); \
48
  server.listen(7860, '0.0.0.0');" > /stremio/proxy.js
49
 
50
+ # 7. The Startup Logic (Absolute Disk Force)
51
  RUN echo "#!/bin/bash \n\
52
  \n\
53
+ # --- STORAGE SETUP --- \n\
54
+ # We use /stremio/data. This is NOT /tmp. It is physical disk space. \n\
55
+ CACHE_ROOT=\"/stremio/data\" \n\
56
+ echo \"💾 FORCING STORAGE TO: \$CACHE_ROOT (OverlayFS)\" \n\
57
  \n\
58
+ # --- SETTINGS --- \n\
59
+ # cacheSize: 25GB (26843545600 bytes) \n\
 
 
 
 
 
60
  \n\
61
+ echo \"{\\\"cacheSize\\\": 26843545600, \\\"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\
 
 
 
 
 
62
  \n\
63
  # Run \n\
64
  node /stremio/proxy.js & \n\
 
68
  ENTRYPOINT ["/usr/bin/dumb-init", "--"]
69
  CMD ["/stremio/start.sh"]
70