Spaces:
Sleeping
Sleeping
| FROM node:18 AS frontend-builder | |
| WORKDIR /app/frontend | |
| COPY frontend/package*.json ./ | |
| RUN npm install | |
| COPY frontend/ . | |
| RUN VITE_API_BASE="" npm run build | |
| FROM python:3.10-slim | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR $HOME/app | |
| COPY --chown=user backend/requirements.txt ./backend/ | |
| RUN pip install --no-cache-dir -r backend/requirements.txt | |
| COPY --chown=user backend/ ./backend/ | |
| COPY --from=frontend-builder --chown=user /app/frontend/dist ./frontend/dist | |
| ENV PYTHONPATH="$HOME/app/backend" | |
| ENV PORT=7860 | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"] | |