-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (27 loc) · 880 Bytes
/
Dockerfile
File metadata and controls
42 lines (27 loc) · 880 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
36
37
38
39
40
41
42
FROM node:20-alpine AS frontend-builder
WORKDIR /build/web
COPY web/package.json web/pnpm-lock.yaml ./
RUN corepack enable \
&& pnpm install --frozen-lockfile
COPY web ./
RUN pnpm build
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
APP_ENV=prod \
HOST=0.0.0.0 \
PORT=9999
WORKDIR /app
COPY pyproject.toml ./
COPY app ./app
COPY migrations ./migrations
COPY web/package.json ./web/package.json
RUN python -m pip install --upgrade pip \
&& python -m pip install .
COPY --from=frontend-builder /build/web/dist ./web/dist
RUN mkdir -p /app/storage /app/app/logs
EXPOSE 9999
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=5 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:9999/health', timeout=3)"
CMD ["python", "-m", "app", "serve"]