Spaces:
Sleeping
Sleeping
Download Dockerfile from skillissue04/sql-repair-env: direct link, hf CLI and curl.
- Browser
- Download file 1.53 kB
-
https://huggingface.co/spaces/skillissue04/sql-repair-env/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/skillissue04/sql-repair-env/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/skillissue04/sql-repair-env/resolve/main/Dockerfile
1.53 kB
| # ββ Stage 1: builder ββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| FROM python:3.11-slim AS builder | |
| WORKDIR /build | |
| # Install build dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| gcc \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy and install Python dependencies into a prefix | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --prefix=/install -r requirements.txt | |
| # ββ Stage 2: runtime ββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Copy installed packages from builder | |
| COPY --from=builder /install /usr/local | |
| # Copy application code | |
| COPY app/ ./app/ | |
| COPY server/ ./server/ | |
| COPY data/ ./data/ | |
| COPY db/ ./db/ | |
| COPY inference.py . | |
| COPY openenv.yaml . | |
| # Validate that the app imports cleanly at build time | |
| COPY validate.py . | |
| RUN python validate.py | |
| # Expose server port | |
| EXPOSE 7860 | |
| # Health check β ping /health every 30s, allow 10s startup | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \ | |
| CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/health')" | |
| # Run the FastAPI server | |
| CMD ["python", "-m", "uvicorn", "server.app:app", \ | |
| "--host", "0.0.0.0", "--port", "7860", \ | |
| "--workers", "1", "--log-level", "info"] | |