feat: Docker deploy serving SPA and API on :8080
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
# Stage 1 — build Vue SPA
|
||||
FROM node:20 AS frontend-build
|
||||
WORKDIR /frontend
|
||||
COPY frontend/package.json frontend/package-lock.json ./
|
||||
RUN npm ci
|
||||
COPY frontend/ ./
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2 — FastAPI + built SPA
|
||||
FROM python:3.12-slim
|
||||
WORKDIR /app
|
||||
|
||||
ENV DATA_DIR=/data \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1
|
||||
|
||||
COPY backend/requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY backend/app ./app
|
||||
COPY --from=frontend-build /frontend/dist ./frontend/dist
|
||||
|
||||
EXPOSE 8080
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"]
|
||||
Reference in New Issue
Block a user