Spaces:
Build error
Build error
| FROM python:3.9-slim | |
| WORKDIR /app | |
| # Copy backend code | |
| COPY backend /app/backend | |
| # Copy backend utility modules (if any are outside /backend, add more COPY lines) | |
| # (Not needed if all are in /backend) | |
| # Copy frontend static files | |
| COPY frontend /app/frontend | |
| # Copy requirements | |
| COPY backend/requirements.txt /app/requirements.txt | |
| # Install dependencies | |
| RUN pip install --no-cache-dir -r /app/requirements.txt | |
| # Install nginx | |
| # Install nginx | |
| RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* | |
| # Copy minimal main nginx.conf | |
| COPY nginx.main.conf /etc/nginx/nginx.conf | |
| # Copy your site config | |
| COPY nginx.conf /etc/nginx/conf.d/default.conf | |
| # Expose the port nginx will listen on | |
| EXPOSE 7860 | |
| # Start FastAPI backend and nginx | |
| CMD uvicorn backend.main:app --host 0.0.0.0 --port 8000 & nginx -g 'daemon off;' |