-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (25 loc) · 768 Bytes
/
Copy pathDockerfile
File metadata and controls
36 lines (25 loc) · 768 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
# Multi-stage build: Frontend + Backend in a single image
FROM node:18-alpine AS frontend-build
WORKDIR /frontend
# Copy frontend package files
COPY frontend/package*.json ./
RUN npm ci
# Copy frontend source and build
COPY frontend/ ./
RUN npm run build
# Final stage: Python backend with built frontend
FROM python:3.11-slim
WORKDIR /app
# Install Python dependencies
COPY backend/requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy backend code
COPY backend/ ./
# Copy built frontend from build stage
COPY --from=frontend-build /frontend/dist ./static
# Create necessary directories
RUN mkdir -p exports database
# Expose port
EXPOSE 8000
# Run the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]