Spaces:
Runtime error
Runtime error
| # Stage 1: build frontend | |
| FROM node:18-bullseye as frontend-builder | |
| WORKDIR /frontend | |
| COPY frontend/package.json frontend/package-lock.json* /frontend/ | |
| RUN npm install --legacy-peer-deps | |
| COPY frontend/ /frontend/ | |
| RUN npm run build | |
| # Stage 2: python runtime | |
| FROM python:3.10-slim | |
| ENV PYTHONUNBUFFERED=1 | |
| WORKDIR /app | |
| # Install system deps (tesseract for OCR) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| tesseract-ocr \ | |
| libgl1 \ | |
| libsndfile1 \ | |
| poppler-utils \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy backend | |
| COPY backend/requirements.txt /app/ | |
| RUN pip install --no-cache-dir -r /app/requirements.txt | |
| COPY backend/app /app/app | |
| # Copy frontend build into static folder | |
| COPY --from=frontend-builder /frontend/build /app/frontend_build | |
| # Expose port and run | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] |