saap-plattform / Dockerfile
Hwandji's picture
fix: correct backend path in Dockerfile for HF deployment
8d9f0ac
raw
history blame
1.1 kB
# SAAP - Hugging Face Deployment
# Multi-stage build: Frontend → Backend
FROM node:20-slim AS frontend-builder
WORKDIR /app/frontend
# Install frontend dependencies
COPY frontend/package*.json ./
RUN npm ci
# Build frontend
COPY frontend/ ./
RUN npm run build
# ============================================
# Python Backend Stage
# ============================================
FROM python:3.11-slim
WORKDIR /app
# Install minimal system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY backend/requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy backend code to /app (NOT /app/backend)
COPY backend/ ./
# Copy built frontend from builder stage
COPY --from=frontend-builder /app/frontend/dist ./frontend/dist
# Environment variables
ENV PYTHONUNBUFFERED=1
ENV PORT=7860
# Expose Hugging Face Spaces port
EXPOSE 7860
# Start FastAPI (serves API + frontend static files)
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]