Download Dockerfile from acpcchatbotadmin/acpcchatbot_testing_first: direct link, hf CLI and curl.
- Browser
- Download file 863 Bytes
-
https://huggingface.co/spaces/acpcchatbotadmin/acpcchatbot_testing_first/resolve/8c524bf4d86e77dec31cd1042e61dfd248ba6170/Dockerfile
- Command line
-
hf download hf://spaces/acpcchatbotadmin/acpcchatbot_testing_first@8c524bf4d86e77dec31cd1042e61dfd248ba6170/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/acpcchatbotadmin/acpcchatbot_testing_first/resolve/8c524bf4d86e77dec31cd1042e61dfd248ba6170/Dockerfile
863 Bytes
| # Stage 1: Build dependencies | |
| FROM python:3.11-slim AS builder | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --user --no-cache-dir -r requirements.txt | |
| # Stage 2: Runtime | |
| FROM python:3.11-slim AS runtime | |
| WORKDIR /app | |
| # Copy installed packages from builder | |
| COPY --from=builder /root/.local /root/.local | |
| ENV PATH=/root/.local/bin:$PATH | |
| # Copy application code only (no tests, no eval) | |
| COPY app/ ./app/ | |
| # HF Spaces runs as a non-root user (UID 1000) | |
| # Create the user to match HF's runtime UID | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| # HF Spaces requires port 7860 | |
| EXPOSE 7860 | |
| # Single worker — HF free tier has ~16GB RAM but cold starts are common; | |
| # single worker avoids OOM on smaller hardware tiers. | |
| # Increase --workers to 2 only on upgraded hardware tiers. | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] |