Spaces:
Sleeping
Sleeping
Download Dockerfile from mishig/openai-math-explorer: direct link, hf CLI and curl.
- Browser
- Download file 1.21 kB
-
https://huggingface.co/spaces/mishig/openai-math-explorer/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/mishig/openai-math-explorer/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/mishig/openai-math-explorer/resolve/main/Dockerfile
1.21 kB
| # Frontend: Svelte + Vite -> /static | |
| FROM node:24-slim AS web | |
| WORKDIR /web | |
| RUN corepack enable | |
| COPY frontend/package.json frontend/pnpm-lock.yaml ./ | |
| RUN pnpm install --frozen-lockfile | |
| COPY frontend/ ./ | |
| RUN pnpm build | |
| # API: FastAPI + Qwen3-Embedding-0.6B on CPU | |
| FROM python:3.12-slim | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH \ | |
| HF_HOME=/home/user/.cache/huggingface \ | |
| PYTHONUNBUFFERED=1 \ | |
| TOKENIZERS_PARALLELISM=false | |
| WORKDIR /home/user/app | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir --user torch==2.14.1 --index-url https://download.pytorch.org/whl/cpu \ | |
| && pip install --no-cache-dir --user -r requirements.txt | |
| # Bake the model into the image so cold starts don't download it. | |
| RUN python -c "from huggingface_hub import snapshot_download; \ | |
| snapshot_download('Qwen/Qwen3-Embedding-0.6B', revision='97b0c614be4d77ee51c0cef4e5f07c00f9eb65b3', \ | |
| allow_patterns=['*.json', '*.safetensors', '*.txt', '1_Pooling/*'])" | |
| COPY --chown=user backend/ backend/ | |
| COPY --chown=user index/ index/ | |
| COPY --chown=user --from=web /static static/ | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"] | |