33 lines
617 B
Docker
33 lines
617 B
Docker
# Stage 1: Build frontend
|
|
FROM node:20-alpine AS frontend-builder
|
|
WORKDIR /build
|
|
|
|
COPY frontend/package.json frontend/package-lock.json* ./
|
|
RUN npm install
|
|
|
|
COPY frontend/ ./
|
|
RUN npm run build
|
|
|
|
# Stage 2: Python backend
|
|
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install dependencies
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy backend
|
|
COPY app/ ./app/
|
|
|
|
# Copy built frontend
|
|
COPY --from=frontend-builder /build/dist ./frontend/
|
|
|
|
# Environment
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|