-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (20 loc) · 789 Bytes
/
Dockerfile
File metadata and controls
27 lines (20 loc) · 789 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
# ---- Stage 1: Build the frontend ----
FROM node:20-slim AS frontend-build
WORKDIR /build
COPY frontend/package*.json ./frontend/
RUN cd frontend && npm ci
COPY frontend/ ./frontend/
RUN cd frontend && npm run build
# Output is at /build/static (vite outDir: '../static')
# ---- Stage 2: Python application ----
FROM mcr.microsoft.com/devcontainers/python:3.12-bookworm
WORKDIR /app
COPY requirements.txt .
RUN pip install --upgrade pip && \
pip install -r requirements.txt
COPY . .
# Copy the built frontend into /app/static
COPY --from=frontend-build /build/static ./static
# Use a non-privileged port by default; the Container App ingress targetPort should match.
EXPOSE 8080
CMD ["sh", "-c", "uvicorn main:app --host 0.0.0.0 --port ${PORT:-8080}"]