Download Dockerfile from sitcod3/modul-s: direct link, hf CLI and curl.
- Browser
- Download file 1.51 kB
-
https://huggingface.co/spaces/sitcod3/modul-s/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/sitcod3/modul-s/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/sitcod3/modul-s/resolve/main/Dockerfile
1.51 kB
| # ---- Stage 1: Build ---- | |
| # Mirrors BRIDGE Modul-E's proven HF pattern (node:20-alpine). | |
| FROM node:20-alpine AS builder | |
| WORKDIR /app | |
| # Vite bakes VITE_* vars in at BUILD time — pass them as build args. | |
| # Empty values keep the demo fallback UI. | |
| ARG VITE_SUPABASE_URL="" | |
| ARG VITE_SUPABASE_ANON_KEY="" | |
| ARG VITE_API_URL="" | |
| ENV VITE_SUPABASE_URL=$VITE_SUPABASE_URL \ | |
| VITE_SUPABASE_ANON_KEY=$VITE_SUPABASE_ANON_KEY \ | |
| VITE_API_URL=$VITE_API_URL | |
| # Install dependencies first (layer caching). | |
| # NOTE: only package.json is copied (no lockfile): the Windows-generated | |
| # lockfile pins win32-only optional native deps (rollup) which break Linux | |
| # builds — npm/cli bug #4828. Dependencies resolve fresh on Alpine/musl. | |
| COPY package.json ./ | |
| RUN npm install --no-audit --no-fund | |
| # Copy source and build frontend + bundle server (dist/server.cjs). | |
| COPY . . | |
| RUN npm run build | |
| # ---- Stage 2: Production ---- | |
| FROM node:20-alpine AS production | |
| WORKDIR /app | |
| # HF Spaces routes to 7860 — the server MUST default to it (see server.ts). | |
| ENV NODE_ENV=production \ | |
| PORT=7860 | |
| # Install production-only dependencies (esbuild, vitest, typescript excluded). | |
| COPY package.json ./ | |
| RUN npm install --omit=dev && npm cache clean --force | |
| # Copy the built output from builder stage. | |
| COPY --from=builder /app/dist ./dist | |
| EXPOSE 7860 | |
| HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ | |
| CMD wget -qO- http://127.0.0.1:7860/api/health >/dev/null 2>&1 || exit 1 | |
| CMD ["node", "dist/server.cjs"] | |