-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (27 loc) · 843 Bytes
/
Copy pathDockerfile
File metadata and controls
37 lines (27 loc) · 843 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
FROM python:3.12-slim AS backend
WORKDIR /app
# Install system deps
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libffi-dev && rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY pyproject.toml .
RUN pip install --no-cache-dir .
# Frontend build stage
FROM node:20-slim AS frontend
WORKDIR /build
COPY frontend/package.json ./
RUN npm install
COPY frontend/ .
RUN npm run build
# Final stage
FROM python:3.12-slim
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libffi-dev && rm -rf /var/lib/apt/lists/*
COPY pyproject.toml .
RUN pip install --no-cache-dir .
COPY --from=frontend /build/dist /app/frontend/dist
COPY . .
RUN rm -rf frontend/src frontend/package.json frontend/package-lock.json frontend/node_modules
EXPOSE 8600
CMD ["python", "main.py"]