- Stage 1 (node:20): builds Vue.js frontend to /app/dist - Stage 2 (python:3.12): FastAPI serves API + static files - main.py: serve Vue.js dist via StaticFiles if /app/dist exists - Removes GET / route (replaced by frontend index.html) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
17 lines
453 B
Docker
17 lines
453 B
Docker
FROM node:20-alpine AS frontend-builder
|
|
WORKDIR /app/frontend
|
|
COPY frontend/package*.json ./
|
|
RUN npm ci
|
|
COPY frontend/ ./
|
|
RUN npm run build
|
|
|
|
FROM python:3.12-slim
|
|
WORKDIR /app
|
|
COPY backend/requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
COPY backend/ .
|
|
COPY --from=frontend-builder /app/frontend/dist /app/dist
|
|
RUN mkdir -p uploads
|
|
EXPOSE 8000
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|