-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (25 loc) · 796 Bytes
/
Dockerfile
File metadata and controls
36 lines (25 loc) · 796 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
# Stage 1: Node build for frontend assets
FROM node:22 AS nodebuilder
WORKDIR /app
COPY package.json ./
COPY frontend ./frontend
COPY build.js ./
RUN npm install --no-audit --no-fund
RUN npm run build
# Stage 2: Python backend
FROM python:3.13-slim
WORKDIR /app
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of your application code
COPY . .
# Copy built frontend assets from nodebuilder
COPY --from=nodebuilder /app/static/dist ./static/dist
COPY --from=nodebuilder /app/templates/dist.html ./templates/dist.html
# Expose the port FastAPI will run on
EXPOSE 8000
# Set environment variables (optional)
ENV PYTHONUNBUFFERED=1
# Start the FastAPI app with Uvicorn
CMD ["python", "app.py"]