# Production stage - Python + pre-built frontend FROM python:3.11-slim WORKDIR /app # Install gcc for any compiled dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ gcc \ && rm -rf /var/lib/apt/lists/* # Copy Python requirements COPY backend/requirements.txt ./backend/ RUN pip install --no-cache-dir -r backend/requirements.txt # Copy backend code COPY backend/ ./backend/ # Copy pre-built frontend COPY dist/ ./dist/ # Set environment ENV PYTHONUNBUFFERED=1 ENV PORT=7860 # Expose port EXPOSE 7860 # Start the Flask app CMD ["python", "backend/app.py"]