infra/stacks/f1-stream/files/Dockerfile

28 lines
586 B
Text
Raw Normal View History

## Stage 1: Build frontend
FROM node:22-slim AS frontend-builder
WORKDIR /frontend
COPY frontend/package.json frontend/package-lock.json* ./
RUN npm install
COPY frontend/ ./
RUN npm run build
## Stage 2: Python backend + static frontend
FROM python:3.13-slim-bookworm
WORKDIR /app
2023-09-24 17:08:33 +00:00
COPY backend/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY backend/ ./backend/
# Copy built frontend into the image
COPY --from=frontend-builder /frontend/build ./frontend/build
EXPOSE 8000
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]