File size: 694 Bytes
8a1fc38 c75184e 8a1fc38 c75184e 8a1fc38 c75184e 8a1fc38 c75184e 8a1fc38 cd72a4a 8a1fc38 c75184e 8a1fc38 c75184e 8a1fc38 c75184e 8a1fc38 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | # Build stage
FROM python:3.11-slim as builder
WORKDIR /app
COPY requirements.txt .
RUN pip install --user --no-cache-dir -r requirements.txt
# Run stage
FROM python:3.11-slim
WORKDIR /app
# Copy dependencies from builder
COPY --from=builder /root/.local /root/.local
ENV PATH=/root/.local/bin:$PATH
# Copy application code
COPY src /app/backend/src
# Copy knowledge base for quiz parsing
COPY knowledge-base /app/knowledge-base
# Set environment variables
ENV PYTHONPATH=/app
ENV ENVIRONMENT=production
# Cloud Run injects PORT, but default to 8080
ENV PORT=8080
EXPOSE $PORT
# Start FastAPI application
CMD ["sh", "-c", "uvicorn backend.src.main:app --host 0.0.0.0 --port ${PORT}"]
|