-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (27 loc) · 821 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (27 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# syntax=docker/dockerfile:1
FROM node:20-slim AS web-build
WORKDIR /app/web
COPY web/package.json web/package-lock.json ./
RUN npm ci
COPY web/ ./
RUN npm run build
FROM python:3.11-slim AS runtime
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
APP_ENV=production \
SESSION_TTL_SECONDS=3600 \
OMP_NUM_THREADS=1 \
MKL_NUM_THREADS=1 \
OPENBLAS_NUM_THREADS=1 \
NUMEXPR_NUM_THREADS=1 \
MALLOC_ARENA_MAX=2
COPY requirements.prod.txt .
RUN pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cpu torch==2.10.0
RUN pip install --no-cache-dir -r requirements.prod.txt
COPY game ./game
COPY rl ./rl
COPY server ./server
COPY --from=web-build /app/web/dist ./web/dist
EXPOSE 8000
CMD sh -c "uvicorn server.app:app --host 0.0.0.0 --port ${PORT:-8000}"