Dockerfile 723 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # Build frontend
  2. FROM node:22-bookworm-slim AS frontend-builder
  3. WORKDIR /app/frontend
  4. COPY frontend/package*.json ./
  5. RUN npm ci
  6. COPY frontend/ ./
  7. RUN npm run build
  8. # Production image
  9. FROM python:3.13-slim
  10. WORKDIR /app
  11. # Install dependencies
  12. COPY requirements.txt ./
  13. RUN pip install --no-cache-dir -r requirements.txt
  14. # Copy backend
  15. COPY backend/ ./backend/
  16. # Copy built frontend from builder stage
  17. COPY --from=frontend-builder /app/static ./static
  18. # Create data directory for persistent storage
  19. RUN mkdir -p /app/data /app/logs
  20. # Environment variables
  21. ENV PYTHONUNBUFFERED=1
  22. ENV DATA_DIR=/app/data
  23. EXPOSE 8000
  24. # Run the application
  25. CMD ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "8000"]