Dockerfile 769 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 --ignore-scripts && \
  6. npm rebuild esbuild
  7. COPY frontend/ ./
  8. RUN npm run build
  9. # Production image
  10. FROM python:3.13-slim
  11. WORKDIR /app
  12. # Install dependencies
  13. COPY requirements.txt ./
  14. RUN pip install --no-cache-dir -r requirements.txt
  15. # Copy backend
  16. COPY backend/ ./backend/
  17. # Copy built frontend from builder stage
  18. COPY --from=frontend-builder /app/static ./static
  19. # Create data directory for persistent storage
  20. RUN mkdir -p /app/data /app/logs
  21. # Environment variables
  22. ENV PYTHONUNBUFFERED=1
  23. ENV DATA_DIR=/app/data
  24. EXPOSE 8000
  25. # Run the application
  26. CMD ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "8000"]