Download Dockerfile from tandevllc/axis: direct link, hf CLI and curl.
- Browser
- Download file 1 kB
-
https://huggingface.co/spaces/tandevllc/axis/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/tandevllc/axis/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/tandevllc/axis/resolve/main/Dockerfile
1 kB
| # Minimal Python base | |
| FROM python:3.10-slim | |
| # System deps (git for HF caching symlinks, etc.) | |
| RUN apt-get update && apt-get install -y --no-install-recommends git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Non-root user + app and data dirs | |
| RUN useradd -m -u 1000 user && mkdir -p /app /data && chown -R user:user /app /data | |
| USER user | |
| ENV PATH="/home/user/.local/bin:${PATH}" | |
| # Persist HF cache & your DB between restarts | |
| ENV HF_HOME=/data/.cache/huggingface \ | |
| API_DB_PATH=/data/api_keys.sqlite3 \ | |
| DEFAULT_API_KEY=sk-1234 \ | |
| MODEL_ID=TinyLlama/TinyLlama-1.1B-Chat-v1.0 \ | |
| PORT=7860 | |
| WORKDIR /app | |
| # Python deps | |
| COPY --chown=user:user requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip \ | |
| && pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu torch \ | |
| && pip install --no-cache-dir -r requirements.txt | |
| # App code | |
| COPY --chown=user:user . /app | |
| # Create (idempotent) DB and start the server every boot | |
| CMD python init_db.py && python server.py | |