Spaces:
Paused
Paused
Download Dockerfile from ejjays/nexstream-api: direct link, hf CLI and curl.
- Browser
- Download file 1.92 kB
-
https://huggingface.co/spaces/ejjays/nexstream-api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/ejjays/nexstream-api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/ejjays/nexstream-api/resolve/main/Dockerfile
1.92 kB
| # Hugging Face Spaces (Docker SDK) build. | |
| # Place this file as ./Dockerfile at the Space repo root. | |
| # Space layout mirrors the monorepo: package.json + package-lock.json + | |
| # packages/ + web/shared + web/backend (see deploy-hf-space job). | |
| FROM node:22-slim | |
| SHELL ["/bin/bash", "-o", "pipefail", "-c"] | |
| # hadolint ignore=DL3008 | |
| RUN set -ex; \ | |
| export DEBIAN_FRONTEND=noninteractive; \ | |
| apt-get update; \ | |
| apt-get install -y --no-install-recommends \ | |
| python3 python3-pip python3-full ffmpeg curl unzip; \ | |
| rm -rf /var/lib/apt/lists/* | |
| # yt-dlp toolchain in a world-readable venv | |
| RUN python3 -m venv /opt/tool-venv \ | |
| && /opt/tool-venv/bin/pip install --no-cache-dir --upgrade pip \ | |
| && /opt/tool-venv/bin/pip install --no-cache-dir --upgrade --pre \ | |
| yt-dlp kaggle yt-dlp-getpot-wpc | |
| # reuse node user (uid 1000) hf expects | |
| RUN mkdir -p /home/node/app && chown node:node /home/node/app | |
| USER node | |
| ENV HOME=/home/node \ | |
| PATH=/home/node/.deno/bin:/opt/tool-venv/bin:/home/node/.local/bin:$PATH | |
| WORKDIR $HOME/app | |
| RUN curl -fsSL https://deno.land/install.sh | sh | |
| # single root lockfile; -w keeps the image lean (no mobile/frontend deps) | |
| COPY --chown=node:node package.json package-lock.json ./ | |
| COPY --chown=node:node web/shared/package.json ./web/shared/ | |
| COPY --chown=node:node web/backend/package.json ./web/backend/ | |
| COPY --chown=node:node packages/extractors/package.json ./packages/extractors/ | |
| RUN npm ci --ignore-scripts -w web/backend -w web/shared -w packages/extractors | |
| COPY --chown=node:node web/shared/ ./web/shared/ | |
| COPY --chown=node:node packages/extractors/ ./packages/extractors/ | |
| RUN (cd packages/extractors && npm run build) | |
| WORKDIR $HOME/app/web/backend | |
| COPY --chown=node:node web/backend/ ./ | |
| RUN npx tsc && mkdir -p temp | |
| ENV PORT=7860 \ | |
| API_ONLY=true \ | |
| NODE_ENV=production | |
| EXPOSE 7860 | |
| CMD ["node", "--import", "./dist/backend/src/instrument.js", "dist/backend/src/app.js"] | |