25 lines
537 B
Docker
25 lines
537 B
Docker
# Stage 1: Build frontend
|
|
FROM node:20-bookworm AS frontend-build
|
|
WORKDIR /frontend
|
|
COPY frontend/package.json frontend/package-lock.json ./
|
|
RUN npm ci
|
|
COPY frontend/ ./
|
|
RUN npm run build
|
|
|
|
# Stage 2: Python runtime
|
|
FROM python:3.12-slim
|
|
WORKDIR /backend
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY app/ ./app/
|
|
COPY run.py .
|
|
|
|
# Copy frontend build output
|
|
COPY --from=frontend-build /frontend/dist ./frontend/dist
|
|
|
|
EXPOSE 18000
|
|
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "18000"]
|