FROM node:18-bullseye-slim USER root # 1. Install Dependencies RUN apt-get update && \ apt-get install -y wget ffmpeg dumb-init procps && \ apt-get autoremove -y && \ rm -rf /var/lib/apt/lists/* # 2. Setup Stremio WORKDIR /stremio RUN mkdir -p /root/.stremio-server # 3. Create a SPECIFIC Disk Directory (Not /tmp) # This forces it to use the container's overlay storage (Disk) RUN mkdir -p /stremio/data RUN wget https://dl.strem.io/four/v4.4.168/server.js -O server.js RUN wget https://dl.strem.io/four/v4.4.168/stremio.asar -O stremio.asar # 4. Install Proxy RUN npm install http-proxy # 5. Envs ENV NO_CORS=1 ENV CASTING_DISABLED=1 ENV STREAMING_DISABLED=0 ENV PORT=11470 # 6. Status Page RUN echo "const http = require('http'); \ const httpProxy = require('http-proxy'); \ const proxy = httpProxy.createProxyServer({}); \ const STREMIO_TARGET = 'http://127.0.0.1:11470'; \ \ proxy.on('error', function (err, req, res) { \ res.writeHead(500); res.end('Booting...'); \ }); \ \ const server = http.createServer((req, res) => { \ if (req.url === '/') { \ res.writeHead(200, {'Content-Type': 'text/html'}); \ res.end('

💾 REAL DISK MODE
âš¡ 25GB CACHE | 500 CONNS

'); \ } else { \ proxy.web(req, res, { target: STREMIO_TARGET }); \ } \ }); \ server.listen(7860, '0.0.0.0');" > /stremio/proxy.js # 7. The Startup Logic (Absolute Disk Force) RUN echo "#!/bin/bash \n\ \n\ # --- STORAGE SETUP --- \n\ # We use /stremio/data. This is NOT /tmp. It is physical disk space. \n\ CACHE_ROOT=\"/stremio/data\" \n\ echo \"💾 FORCING STORAGE TO: \$CACHE_ROOT (OverlayFS)\" \n\ \n\ # --- SETTINGS --- \n\ # cacheSize: 25GB (26843545600 bytes) \n\ \n\ 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\ \n\ # Run \n\ node /stremio/proxy.js & \n\ node /stremio/server.js" > /stremio/start.sh && chmod +x /stremio/start.sh EXPOSE 7860 ENTRYPOINT ["/usr/bin/dumb-init", "--"] CMD ["/stremio/start.sh"]