Spaces:
Sleeping
Sleeping
Download Dockerfile from czar-ml/sentiment-api: direct link, hf CLI and curl.
- Browser
- Download file 666 Bytes
-
https://huggingface.co/spaces/czar-ml/sentiment-api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/czar-ml/sentiment-api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/czar-ml/sentiment-api/resolve/main/Dockerfile
666 Bytes
| # Stage 1: Builder | |
| FROM python:3.11-slim AS builder | |
| RUN useradd -m -u 1000 appuser | |
| USER appuser | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --user -r requirements.txt | |
| # Stage 2: Runtime | |
| FROM python:3.11-slim | |
| WORKDIR /app | |
| RUN useradd -m -u 1000 appuser | |
| RUN mkdir -p /home/appuser/mlruns && \ | |
| chown appuser:appuser /home/appuser/mlruns | |
| COPY --from=builder /home/appuser/.local /home/appuser/.local | |
| COPY ./app ./app | |
| ENV PATH=/home/appuser/.local/bin:$PATH | |
| ENV MLFLOW_TRACKING_URI=file:///home/appuser/mlruns | |
| ENV GIT_PYTHON_REFRESH=quiet | |
| USER appuser | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] |