Spaces:
Paused
Paused
Download Dockerfile from 2Btainment/repospace: direct link, hf CLI and curl.
- Browser
- Download file 1.42 kB
-
https://huggingface.co/spaces/2Btainment/repospace/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/2Btainment/repospace/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/2Btainment/repospace/resolve/main/Dockerfile
1.42 kB
| # RepoSpace — Hugging Face Docker Space | |
| # Control plane: FastAPI. Previews: constrained subprocess sandbox (no DinD / Firecracker). | |
| FROM node:22-bookworm-slim AS frontend | |
| WORKDIR /fe | |
| COPY frontend/package.json frontend/package-lock.json* ./ | |
| RUN npm install --no-audit --no-fund | |
| COPY frontend/ ./ | |
| RUN npm run build | |
| FROM python:3.12-slim-bookworm | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| REPOSPACE_STATIC=/app/frontend/dist \ | |
| REPOSPACE_DATA=/data \ | |
| PORT=7860 \ | |
| HOST=0.0.0.0 | |
| # Node for user-repo npm builds + git/curl for diagnostics | |
| COPY --from=node:22-bookworm-slim /usr/local/bin/node /usr/local/bin/node | |
| COPY --from=node:22-bookworm-slim /usr/local/lib/node_modules /usr/local/lib/node_modules | |
| RUN ln -sf /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \ | |
| && ln -sf /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| ca-certificates curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY backend/ /app/backend/ | |
| COPY scripts/ /app/scripts/ | |
| COPY --from=frontend /fe/dist /app/frontend/dist | |
| # Persistent session dir when HF mounts /data; else created at runtime under /tmp | |
| RUN mkdir -p /data /tmp/repospace | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "7860"] | |