39 lines
954 B
Docker
39 lines
954 B
Docker
# Multi-stage Dockerfile for lotusgen
|
|
|
|
# Stage 1: Frontend Build
|
|
FROM node:22-alpine AS frontend-builder
|
|
WORKDIR /app/frontend
|
|
COPY frontend/package*.json ./
|
|
RUN npm install
|
|
COPY frontend/ ./
|
|
RUN npm run build
|
|
|
|
# Stage 2: Python Runtime with uv
|
|
FROM python:3.14-slim AS runtime
|
|
WORKDIR /app
|
|
|
|
# Install uv
|
|
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
|
|
|
|
# Environment variables
|
|
ENV PYTHONUNBUFFERED=1 \
|
|
LOTUSGEN_DB_PATH=/app/data/lotusgen.db \
|
|
LOTUSGEN_ARTIFACTS_DIR=/app/artifacts
|
|
|
|
# Install backend dependencies via uv
|
|
COPY backend/requirements.txt ./backend/requirements.txt
|
|
RUN uv pip install --system -r backend/requirements.txt
|
|
|
|
# Copy backend code
|
|
COPY backend/ ./backend/
|
|
|
|
# Copy built frontend from Stage 1
|
|
COPY --from=frontend-builder /app/frontend/dist ./frontend/dist
|
|
|
|
# Create volume mount directories
|
|
RUN mkdir -p /app/data /app/artifacts
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]
|