Spaces:
Running
Running
Download web/Dockerfile from Aynkhn/WorkPilot-AI: direct link, hf CLI and curl.
- Browser
- Download file 1.91 kB
-
https://huggingface.co/spaces/Aynkhn/WorkPilot-AI/resolve/main/web/Dockerfile
- Command line
-
hf download hf://spaces/Aynkhn/WorkPilot-AI/web/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Aynkhn/WorkPilot-AI/resolve/main/web/Dockerfile
1.91 kB
| # syntax=docker/dockerfile:1.7 | |
| # WorkPilot web dashboard (Next.js standalone output, Node runtime). Build context: web/ | |
| # docker build -t workpilot-web --build-arg NEXT_PUBLIC_API_URL=https://api.example.com web | |
| # | |
| # The app needs a Node server, not a static export: the session cookie is set by a route | |
| # handler (src/app/api/session/[action]/route.ts) that calls the API at WP_API_URL (runtime | |
| # env, may be a private address). NEXT_PUBLIC_API_URL is inlined into the browser bundle at | |
| # BUILD time, so build one image per API origin (staging, production). | |
| ARG NODE_VERSION=24 | |
| FROM node:${NODE_VERSION}-bookworm-slim AS deps | |
| WORKDIR /app | |
| COPY package.json package-lock.json ./ | |
| RUN npm ci --no-audit --no-fund | |
| FROM node:${NODE_VERSION}-bookworm-slim AS build | |
| WORKDIR /app | |
| ARG NEXT_PUBLIC_API_URL=http://localhost:8000 | |
| ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL} \ | |
| NEXT_OUTPUT=standalone \ | |
| NEXT_TELEMETRY_DISABLED=1 | |
| COPY --from=deps /app/node_modules ./node_modules | |
| COPY . . | |
| # public/ is empty and untracked (git keeps no empty folders); the runtime stage copies it. | |
| RUN mkdir -p public && npm run build | |
| FROM node:${NODE_VERSION}-bookworm-slim AS runtime | |
| WORKDIR /app | |
| ENV NODE_ENV=production \ | |
| NEXT_TELEMETRY_DISABLED=1 \ | |
| PORT=3000 \ | |
| HOSTNAME=0.0.0.0 | |
| RUN groupadd --system --gid 10001 web \ | |
| && useradd --system --uid 10001 --gid web --no-create-home web \ | |
| && mkdir -p .next \ | |
| && chown web:web .next | |
| COPY --from=build --chown=web:web /app/public ./public | |
| COPY --from=build --chown=web:web /app/.next/standalone ./ | |
| COPY --from=build --chown=web:web /app/.next/static ./.next/static | |
| USER web | |
| EXPOSE 3000 | |
| HEALTHCHECK --interval=15s --timeout=5s --start-period=20s --retries=5 \ | |
| CMD ["node", "-e", "fetch('http://127.0.0.1:'+(process.env.PORT||3000)+'/login').then(r=>{process.exitCode=r.ok?0:1}).catch(()=>{process.exitCode=1})"] | |
| STOPSIGNAL SIGTERM | |
| CMD ["node", "server.js"] | |