2026-06-04 19:09:31 +03:30
|
|
|
# Barg-e Vasat web (Next.js 16 static export → nginx)
|
|
|
|
|
# The app is output:"export" (fully client-side), so we build the static `out/`
|
|
|
|
|
# and serve it with nginx. NEXT_PUBLIC_* are baked at build time.
|
2026-06-04 19:59:27 +03:30
|
|
|
# npm ci (deterministic, installs the exact musl optional binaries from the
|
|
|
|
|
# lockfile) — `npm install` crashes here ("Exit handler never called") resolving
|
|
|
|
|
# Next SWC + Tailwind v4 native deps.
|
2026-06-04 19:09:31 +03:30
|
|
|
FROM mirror.soroushasadi.com/node:20-alpine AS build
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
COPY package*.json ./
|
2026-06-04 19:59:27 +03:30
|
|
|
# npm registry. Default = HTTPS Nexus (CI runner trusts the cert). Override with
|
|
|
|
|
# NPM_REGISTRY=http://<nexus-ip>:8081/repository/npm-group/ for hosts whose trust
|
|
|
|
|
# store lacks the mirror's intermediate (PartialChain) — e.g. local Docker Desktop.
|
|
|
|
|
# strict-ssl=false also tolerates the partial chain when HTTPS is used.
|
2026-06-05 08:53:46 +03:30
|
|
|
ARG NPM_REGISTRY=http://171.22.25.73:8081/repository/npm-group/
|
2026-06-04 19:59:27 +03:30
|
|
|
RUN npm ci --legacy-peer-deps --strict-ssl=false --no-audit --no-fund \
|
|
|
|
|
--registry "${NPM_REGISTRY}"
|
2026-06-04 19:09:31 +03:30
|
|
|
COPY . .
|
|
|
|
|
# Live mode + the API origin the BROWSER will use (host-mapped port / LAN IP).
|
|
|
|
|
ARG NEXT_PUBLIC_USE_SERVER=1
|
|
|
|
|
ARG NEXT_PUBLIC_SERVER_URL=http://localhost:1505
|
|
|
|
|
ENV NEXT_PUBLIC_USE_SERVER=$NEXT_PUBLIC_USE_SERVER
|
|
|
|
|
ENV NEXT_PUBLIC_SERVER_URL=$NEXT_PUBLIC_SERVER_URL
|
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
|
|
FROM mirror.soroushasadi.com/nginx:alpine
|
|
|
|
|
COPY --from=build /app/out /usr/share/nginx/html
|
|
|
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
|
EXPOSE 80
|
|
|
|
|
HEALTHCHECK --interval=10s --timeout=5s --retries=6 --start-period=10s \
|
|
|
|
|
CMD wget -q -O- http://127.0.0.1/ || exit 1
|