void0028 commited on
Commit
fd9356b
Β·
verified Β·
1 Parent(s): b7de55b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -13
Dockerfile CHANGED
@@ -8,11 +8,9 @@ RUN apt-get update && \
8
  apt-get autoremove -y && \
9
  rm -rf /var/lib/apt/lists/*
10
 
11
- # 2. Setup Directories & ENGINE CONFIG (The Max Stuff)
12
  WORKDIR /stremio
13
- # We pre-create the settings file to force 2GB Cache + Ultra Fast Profile
14
- RUN mkdir -p /root/.stremio-server && \
15
- echo '{"cacheSize": 2147483648, "torrentProfile": "ultra_fast"}' > /root/.stremio-server/server-settings.json
16
 
17
  # 3. Download Stremio Engine
18
  RUN wget https://dl.strem.io/four/v4.4.168/server.js -O server.js
@@ -27,7 +25,7 @@ ENV CASTING_DISABLED=1
27
  ENV STREAMING_DISABLED=0
28
  ENV PORT=11470
29
 
30
- # 6. Create the Proxy Script (The Interface)
31
  RUN echo "const http = require('http'); \
32
  const httpProxy = require('http-proxy'); \
33
  const proxy = httpProxy.createProxyServer({}); \
@@ -42,25 +40,25 @@ proxy.on('error', function (err, req, res) { \
42
  const server = http.createServer((req, res) => { \
43
  if (req.url === '/' || req.url === '/health') { \
44
  res.writeHead(200, { 'Content-Type': 'text/html' }); \
45
- res.end('<body style=\"background:black;color:#00ff00;font-family:monospace;display:flex;align-items:center;justify-content:center;height:100vh;\"><h1>βœ… STREMIO IS LIVE<br><span style=\"color:white;font-size:12px\">Mode: Ultra Fast | Cache: 2GB</span></h1></body>'); \
46
  } else { \
47
  proxy.web(req, res, { target: STREMIO_TARGET }); \
48
  } \
49
  }); \
50
  \
51
  server.listen(7860, '0.0.0.0', () => { \
52
- console.log('----------------------------------------'); \
53
- console.log('βœ… PROXY STARTED ON PORT 7860'); \
54
- console.log('πŸ‘‰ WAITING FOR STREMIO ENGINE...'); \
55
- console.log('----------------------------------------'); \
56
  });" > /stremio/proxy.js
57
 
58
- # 7. Create a Robust Startup Script
 
 
59
  RUN echo "#!/bin/bash \n\
 
60
  node /stremio/proxy.js & \n\
61
  PID_PROXY=\$! \n\
62
  sleep 2 \n\
63
- echo 'πŸš€ STARTING STREMIO ENGINE (ULTRA FAST)...' \n\
64
  node /stremio/server.js & \n\
65
  PID_SERVER=\$! \n\
66
  wait \$PID_SERVER" > /stremio/start.sh && chmod +x /stremio/start.sh
@@ -68,6 +66,6 @@ wait \$PID_SERVER" > /stremio/start.sh && chmod +x /stremio/start.sh
68
  # 8. Expose Port
69
  EXPOSE 7860
70
 
71
- # 9. Run with dumb-init
72
  ENTRYPOINT ["/usr/bin/dumb-init", "--"]
73
  CMD ["/stremio/start.sh"]
 
8
  apt-get autoremove -y && \
9
  rm -rf /var/lib/apt/lists/*
10
 
11
+ # 2. Setup Directories
12
  WORKDIR /stremio
13
+ RUN mkdir -p /root/.stremio-server
 
 
14
 
15
  # 3. Download Stremio Engine
16
  RUN wget https://dl.strem.io/four/v4.4.168/server.js -O server.js
 
25
  ENV STREAMING_DISABLED=0
26
  ENV PORT=11470
27
 
28
+ # 6. Create the Proxy Script
29
  RUN echo "const http = require('http'); \
30
  const httpProxy = require('http-proxy'); \
31
  const proxy = httpProxy.createProxyServer({}); \
 
40
  const server = http.createServer((req, res) => { \
41
  if (req.url === '/' || req.url === '/health') { \
42
  res.writeHead(200, { 'Content-Type': 'text/html' }); \
43
+ res.end('<body style=\"background:black;color:#00ff00;font-family:monospace;display:flex;align-items:center;justify-content:center;height:100vh;\"><h1>βœ… STREMIO IS LIVE<br><span style=\"color:white;font-size:12px\">Profile: Ultra Fast | Cache: 2GB</span></h1></body>'); \
44
  } else { \
45
  proxy.web(req, res, { target: STREMIO_TARGET }); \
46
  } \
47
  }); \
48
  \
49
  server.listen(7860, '0.0.0.0', () => { \
50
+ console.log('βœ… PROXY STARTED'); \
 
 
 
51
  });" > /stremio/proxy.js
52
 
53
+ # 7. Startup Script (The Fix)
54
+ # We write the server-settings.json HERE, at runtime.
55
+ # usage: btProfile = "ultra_fast" is the correct internal key.
56
  RUN echo "#!/bin/bash \n\
57
+ echo '{\"cacheSize\": 2147483648, \"btProfile\": \"ultra_fast\"}' > /root/.stremio-server/server-settings.json \n\
58
  node /stremio/proxy.js & \n\
59
  PID_PROXY=\$! \n\
60
  sleep 2 \n\
61
+ echo 'πŸš€ STARTING STREMIO ENGINE...' \n\
62
  node /stremio/server.js & \n\
63
  PID_SERVER=\$! \n\
64
  wait \$PID_SERVER" > /stremio/start.sh && chmod +x /stremio/start.sh
 
66
  # 8. Expose Port
67
  EXPOSE 7860
68
 
69
+ # 9. Run
70
  ENTRYPOINT ["/usr/bin/dumb-init", "--"]
71
  CMD ["/stremio/start.sh"]