-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (25 loc) · 864 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (25 loc) · 864 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
FROM node:20-bookworm-slim AS frontend-build
WORKDIR /app/frontend
COPY frontend/package.json frontend/package-lock.json ./
ARG VITE_API_BASE_URL=
ARG VITE_APP_API_KEY=
ENV VITE_API_BASE_URL=${VITE_API_BASE_URL}
ENV VITE_APP_API_KEY=${VITE_APP_API_KEY}
RUN npm ci
COPY frontend/ ./
RUN npm run build
FROM python:3.11-slim AS runtime
WORKDIR /app/backend
COPY backend/requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
WORKDIR /app
COPY backend ./backend
COPY --from=frontend-build /app/frontend/dist ./frontend/dist
ENV FLASK_DEBUG=false \
SERVE_FRONTEND=true \
FLASK_HOST=0.0.0.0 \
FLASK_PORT=5001
EXPOSE 5001
HEALTHCHECK --interval=30s --timeout=10s --start-period=20s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:5001/health')" || exit 1
CMD ["python", "backend/run.py"]