-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
19 lines (18 loc) · 687 Bytes
/
Copy pathDockerfile
File metadata and controls
19 lines (18 loc) · 687 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Multi-stage build for Hypastack (Next.js). Build loads the real .env (like the
# host build) so NEXT_PUBLIC_* get inlined and any build-time data access works;
# the .env is stripped before the runtime image so no secrets are baked in.
FROM node:24-bookworm-slim AS build
WORKDIR /app
COPY package*.json ./
RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
COPY . .
RUN npm run build
RUN rm -f .env .env.*
FROM node:24-bookworm-slim AS run
WORKDIR /app
ENV NODE_ENV=production
COPY --from=build --chown=node:node /app /app
USER node
EXPOSE 3000
# .env is mounted read-only at runtime (see quadlet); next start loads it
CMD ["npm","run","start","--","-H","127.0.0.1"]