| FROM node:20-slim AS frontend | |
| WORKDIR /app/frontend | |
| COPY frontend/package.json frontend/package-lock.json* ./ | |
| RUN npm install | |
| COPY frontend ./ | |
| RUN npm run build | |
| FROM python:3.12-slim | |
| WORKDIR /app | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PORT=7860 | |
| RUN apt-get update \ | |
| && apt-get install -y --no-install-recommends gcc build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| COPY backend/requirements.txt backend/requirements.txt | |
| RUN pip install --no-cache-dir -r backend/requirements.txt | |
| COPY backend backend | |
| COPY --from=frontend /app/frontend/dist frontend/dist | |
| EXPOSE 7860 | |
| CMD ["python", "-m", "uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"] | |