Spaces:
Running
Running
| FROM python:3.12-slim AS backend-deps | |
| WORKDIR /app/backend | |
| COPY backend/requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| FROM node:20-slim AS frontend-build | |
| WORKDIR /app/frontend | |
| COPY frontend/package*.json . | |
| RUN npm install | |
| COPY frontend/ . | |
| RUN npm run build | |
| FROM python:3.12-slim | |
| RUN apt-get update \ | |
| && apt-get install -y --no-install-recommends nginx supervisor \ | |
| && rm -rf /var/lib/apt/lists/* | |
| COPY --from=backend-deps /usr/local/lib/python3.12 /usr/local/lib/python3.12 | |
| COPY --from=backend-deps /usr/local/bin /usr/local/bin | |
| COPY --from=frontend-build /app/frontend/dist /usr/share/nginx/html | |
| COPY backend/ /app/backend/ | |
| COPY nginx.conf /etc/nginx/nginx.conf | |
| COPY supervisord.conf /etc/supervisor/conf.d/portal.conf | |
| RUN mkdir -p /data /run/nginx | |
| VOLUME /data | |
| EXPOSE 80 7860 | |
| CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/portal.conf"] | |