Spaces:
Sleeping
Sleeping
| # syntax=docker/dockerfile:1 | |
| FROM node:20-alpine AS frontend-builder | |
| WORKDIR /app/app/frontend | |
| COPY app/frontend/package.json app/frontend/package-lock.json* ./ | |
| RUN npm install --legacy-peer-deps | |
| COPY app/frontend/ ./ | |
| ARG VITE_API_BASE_URL= | |
| ENV VITE_API_BASE_URL=${VITE_API_BASE_URL} | |
| RUN npm run build | |
| FROM python:3.11-slim AS runtime | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 | |
| WORKDIR /app | |
| COPY pyproject.toml ./ | |
| COPY app/backend ./app/backend | |
| COPY app/tests ./app/tests | |
| COPY specs.md PLANS.md AGENTS.md README.md ./ | |
| COPY --from=frontend-builder /app/app/frontend/dist ./app/frontend/dist | |
| COPY scripts/start.sh ./scripts/start.sh | |
| RUN pip install --upgrade pip && pip install -e . | |
| EXPOSE 7860 | |
| HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \ | |
| CMD python -c "import os,urllib.request;port=os.environ.get('PORT','7860');urllib.request.urlopen(f'http://127.0.0.1:{port}/api/health', timeout=3).read()" | |
| CMD ["./scripts/start.sh"] | |