Hermes Agent commited on
Commit
4d5ad47
·
1 Parent(s): f6c8489

Fix OOMKilled by using CPU PyTorch and 2048MB Node heap limit

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -4
Dockerfile CHANGED
@@ -33,8 +33,9 @@ RUN mkdir -p /etc/apt/keyrings \
33
  && apt-get update && apt-get install -y --no-install-recommends jellyfin-server jellyfin-web ffmpeg \
34
  && rm -rf /var/lib/apt/lists/*
35
 
36
- # 3. Install Python Dependencies (Open WebUI, Pyrogram, FastAPI, Uvicorn, HTTPX, Aiohttp)
37
- RUN pip3 install --no-cache-dir aiohttp pyrogram tgcrypto open-webui httpx uvicorn fastapi --break-system-packages || true
 
38
 
39
  # 4. Install Node.js 22.22.2 LTS (meets OmniRoute's minimum required runtime v22.22.2+)
40
  RUN curl -fsSL https://nodejs.org/dist/v22.22.2/node-v22.22.2-linux-x64.tar.gz \
@@ -44,12 +45,13 @@ RUN curl -fsSL https://nodejs.org/dist/v22.22.2/node-v22.22.2-linux-x64.tar.gz \
44
  WORKDIR /omniroute
45
  ENV NEXT_TELEMETRY_DISABLED=1
46
  ENV OMNIROUTE_USE_TURBOPACK=0
47
- ENV NODE_OPTIONS="--max-old-space-size=4096"
 
48
 
49
  RUN git clone --depth 1 https://github.com/diegosouzapw/OmniRoute.git /omniroute \
50
  && npm install --legacy-peer-deps \
51
  && npm rebuild better-sqlite3 --build-from-source \
52
- && NEXT_TELEMETRY_DISABLED=1 OMNIROUTE_USE_TURBOPACK=0 NODE_OPTIONS="--max-old-space-size=4096" npm run build || true
53
 
54
  RUN mkdir -p /root/.cache /data/cache /data/omniroute /data/open-webui
55
  RUN chmod -R 777 /root/.cache /data/cache /omniroute
 
33
  && apt-get update && apt-get install -y --no-install-recommends jellyfin-server jellyfin-web ffmpeg \
34
  && rm -rf /var/lib/apt/lists/*
35
 
36
+ # 3. Install Python Dependencies (CPU PyTorch to avoid massive CUDA wheels, plus Open WebUI & utilities)
37
+ RUN pip3 install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu --break-system-packages \
38
+ && pip3 install --no-cache-dir aiohttp pyrogram tgcrypto open-webui httpx uvicorn fastapi --break-system-packages || true
39
 
40
  # 4. Install Node.js 22.22.2 LTS (meets OmniRoute's minimum required runtime v22.22.2+)
41
  RUN curl -fsSL https://nodejs.org/dist/v22.22.2/node-v22.22.2-linux-x64.tar.gz \
 
45
  WORKDIR /omniroute
46
  ENV NEXT_TELEMETRY_DISABLED=1
47
  ENV OMNIROUTE_USE_TURBOPACK=0
48
+ ENV NODE_OPTIONS="--max-old-space-size=2048"
49
+ ENV DISABLE_ESLINT_PLUGIN=true
50
 
51
  RUN git clone --depth 1 https://github.com/diegosouzapw/OmniRoute.git /omniroute \
52
  && npm install --legacy-peer-deps \
53
  && npm rebuild better-sqlite3 --build-from-source \
54
+ && NEXT_TELEMETRY_DISABLED=1 OMNIROUTE_USE_TURBOPACK=0 NODE_OPTIONS="--max-old-space-size=2048" npm run build || true
55
 
56
  RUN mkdir -p /root/.cache /data/cache /data/omniroute /data/open-webui
57
  RUN chmod -R 777 /root/.cache /data/cache /omniroute