Spaces:
Running
Running
Download Dockerfile from Reaper1909/wade-ips: direct link, hf CLI and curl.
- Browser
- Download file 1 kB
-
https://huggingface.co/spaces/Reaper1909/wade-ips/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Reaper1909/wade-ips/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Reaper1909/wade-ips/resolve/main/Dockerfile
1 kB
| FROM python:3.11-slim | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| DATABASE_URL=sqlite+aiosqlite:////code/data/wade.db | |
| # Run as an unprivileged user (Hugging Face Spaces also runs containers as UID 1000). | |
| RUN useradd --create-home --uid 1000 wade | |
| WORKDIR /code | |
| # /code must be writable by the runtime user: SQLite (default DB) lives in /code/data | |
| RUN mkdir -p /code/data && chown -R wade:wade /code | |
| COPY requirements.txt . | |
| RUN pip install --upgrade pip && pip install -r requirements.txt | |
| COPY --chown=wade:wade . . | |
| USER wade | |
| EXPOSE 7860 | |
| HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \ | |
| CMD python -c "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:7860/healthz', timeout=4).status == 200 else 1)" | |
| # --proxy-headers: behind a load balancer / Hugging Face the client scheme and host come from X-Forwarded-* | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--proxy-headers"] | |