-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (27 loc) · 847 Bytes
/
Dockerfile
File metadata and controls
35 lines (27 loc) · 847 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
# Stage 1: Build Frontend
FROM node:20-alpine as frontend-build
WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
# Stage 2: Build Backend and Final Image
FROM python:3.10-slim
WORKDIR /app
# Install system dependencies if needed (e.g. for pyarrow/datafusion)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY backend/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy Backend Code
COPY backend/ ./backend/
# Copy Built Frontend to Backend Static Directory
COPY --from=frontend-build /app/frontend/dist ./backend/static
# Expose Port
EXPOSE 8000
# Set Environment Variables
ENV PYTHONPATH=/app/backend
# Run Application
CMD ["python", "backend/main.py"]