sissississi Claude Opus 4.6 commited on
Commit
e1e78bb
·
1 Parent(s): bc52096

Fix Dockerfile: use node:20-slim with python3 venv

Browse files

Alpine's py3-numpy/scipy packages conflict with pip.
Switch to Debian-slim base with proper venv isolation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. Dockerfile +13 -11
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM node:20-alpine AS base
2
 
3
  # --- Node dependencies ---
4
  FROM base AS deps
@@ -19,12 +19,20 @@ COPY package.json package-lock.json tsconfig.json next.config.ts postcss.config.
19
  ENV NEXT_TELEMETRY_DISABLED=1
20
  RUN npm run build
21
 
22
- # --- Final runner: Node + Python ---
23
- FROM node:20-alpine AS runner
24
  WORKDIR /app
25
 
26
- # Install Python + pip for the OpenEnv API
27
- RUN apk add --no-cache python3 py3-pip py3-numpy py3-scipy
 
 
 
 
 
 
 
 
28
 
29
  ENV NODE_ENV=production
30
  ENV NEXT_TELEMETRY_DISABLED=1
@@ -39,12 +47,6 @@ COPY --from=builder /app/.next/static ./.next/static
39
  # Copy Python RL environment
40
  COPY origami_server/ ./origami_server/
41
  COPY training/ ./training/
42
- COPY requirements.txt ./
43
-
44
- # Install Python deps
45
- RUN pip3 install --no-cache-dir --break-system-packages -r requirements.txt
46
-
47
- # Start script: run both services
48
  COPY start.sh ./
49
  RUN chmod +x start.sh
50
 
 
1
+ FROM node:20-slim AS base
2
 
3
  # --- Node dependencies ---
4
  FROM base AS deps
 
19
  ENV NEXT_TELEMETRY_DISABLED=1
20
  RUN npm run build
21
 
22
+ # --- Final runner ---
23
+ FROM node:20-slim AS runner
24
  WORKDIR /app
25
 
26
+ # Install Python for the OpenEnv API
27
+ RUN apt-get update && apt-get install -y --no-install-recommends \
28
+ python3 python3-pip python3-venv \
29
+ && rm -rf /var/lib/apt/lists/*
30
+
31
+ # Create venv and install Python deps
32
+ RUN python3 -m venv /opt/venv
33
+ ENV PATH="/opt/venv/bin:$PATH"
34
+ COPY requirements.txt ./
35
+ RUN pip install --no-cache-dir -r requirements.txt
36
 
37
  ENV NODE_ENV=production
38
  ENV NEXT_TELEMETRY_DISABLED=1
 
47
  # Copy Python RL environment
48
  COPY origami_server/ ./origami_server/
49
  COPY training/ ./training/
 
 
 
 
 
 
50
  COPY start.sh ./
51
  RUN chmod +x start.sh
52