Alpine breaks under corporate proxy TLS interception. Debian slim works reliably. NODE_TLS_REJECT_UNAUTHORIZED=0 removed from production stages — only kept in build stages where npm registries need it.
42 lines
1.1 KiB
Docker
42 lines
1.1 KiB
Docker
FROM node:22-slim AS builder
|
|
WORKDIR /app/web
|
|
|
|
ARG GITEA_NPM_HOST
|
|
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
|
|
ENV NPM_CONFIG_STRICT_SSL=false
|
|
ENV GITEA_NPM_HOST=$GITEA_NPM_HOST
|
|
|
|
RUN npm config set strict-ssl false \
|
|
&& npm install -g pnpm@10.6.5
|
|
|
|
COPY .npmrc.docker ./.npmrc
|
|
COPY web/package.json ./package.json
|
|
RUN --mount=type=secret,id=gitea_npm_token \
|
|
export GITEA_NPM_TOKEN="$(cat /run/secrets/gitea_npm_token)" && \
|
|
pnpm install --ignore-scripts --lockfile=false
|
|
|
|
COPY web/next.config.ts ./next.config.ts
|
|
COPY web/tsconfig.json ./tsconfig.json
|
|
COPY web/next-env.d.ts ./next-env.d.ts
|
|
COPY web/src/ ./src/
|
|
COPY shared/ ../shared/
|
|
|
|
ARG NEXT_PUBLIC_NOTES_API_URL
|
|
ARG NEXT_PUBLIC_PLATFORM_SERVICE_URL
|
|
ENV NEXT_PUBLIC_NOTES_API_URL=$NEXT_PUBLIC_NOTES_API_URL
|
|
ENV NEXT_PUBLIC_PLATFORM_SERVICE_URL=$NEXT_PUBLIC_PLATFORM_SERVICE_URL
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
RUN pnpm run build
|
|
|
|
FROM node:22-slim
|
|
WORKDIR /app/web
|
|
ENV NODE_ENV=production
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
COPY --from=builder /app/web/.next/standalone ./
|
|
COPY --from=builder /app/web/.next/static ./.next/static
|
|
|
|
EXPOSE 3045
|
|
ENV PORT=3045
|
|
CMD ["node", "web/server.js"]
|