Download Dockerfile from binhugg4/web: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/spaces/binhugg4/web/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/binhugg4/web/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/binhugg4/web/resolve/main/Dockerfile
1.18 kB
| FROM node:22-slim AS builder | |
| ENV PNPM_HOME="/pnpm" | |
| ENV PATH="$PNPM_HOME:$PATH" | |
| ENV NODE_OPTIONS=--max-old-space-size=4096 | |
| RUN corepack enable | |
| WORKDIR /app | |
| # Copy package files first for layer caching | |
| COPY package.json pnpm-lock.yaml ./ | |
| # Install all deps, allow build scripts explicitly | |
| RUN --mount=type=cache,id=pnpm,target=/pnpm/store \ | |
| pnpm install --frozen-lockfile --ignore-scripts && \ | |
| pnpm rebuild @parcel/watcher esbuild vue-demi | |
| # Copy source files | |
| COPY . . | |
| # Build Nuxt app | |
| RUN pnpm build | |
| RUN echo "Build success" | |
| # ββ Production image ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| FROM node:22-slim AS production | |
| WORKDIR /app | |
| # Copy built output | |
| COPY --from=builder /app/.output /app/.output | |
| # HuggingFace Spaces exposes port 7860 | |
| ENV PORT=7860 | |
| ENV HOST=0.0.0.0 | |
| # Nuxt SSR server environment variables | |
| # Override at runtime via HF Space Secrets | |
| ENV NUXT_PUBLIC_API_BASE=https://bin-api.hanbin666.top/user | |
| ENV NUXT_API_BASE_URL=https://bin-api.hanbin666.top | |
| EXPOSE 7860 | |
| CMD ["node", "/app/.output/server/index.mjs"] | |