6ba77eebcf
Build and Deploy Platform / build-and-deploy (push) Failing after 47s
Kaniko builds failed with context deadline exceeded pulling node:24-alpine from index.docker.io through the egress proxy. Seed node:24-alpine into abrban/ and pass BASE_IMAGE build-arg so builds use the internal registry. Co-authored-by: Cursor <cursoragent@cursor.com>
46 lines
1.1 KiB
Docker
46 lines
1.1 KiB
Docker
# ---- Stage 1: Dependencies ----
|
|
ARG BASE_IMAGE=node:24-alpine
|
|
FROM ${BASE_IMAGE} AS deps
|
|
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json* ./
|
|
# lockfile may reference npmmirror; use npmjs.org inside the image build
|
|
RUN sed -i 's|https://registry.npmmirror.com|https://registry.npmjs.org|g' package-lock.json \
|
|
&& npm ci
|
|
|
|
# ---- Stage 2: Build ----
|
|
FROM ${BASE_IMAGE} AS builder
|
|
|
|
WORKDIR /app
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
|
|
ARG NEXT_PUBLIC_API_URL=http://localhost:4000
|
|
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
RUN npm run build
|
|
|
|
# ---- Stage 3: Production ----
|
|
FROM ${BASE_IMAGE} AS production
|
|
|
|
RUN apk add --no-cache dumb-init
|
|
|
|
ENV NODE_ENV=production
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
WORKDIR /app
|
|
|
|
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
|
|
|
COPY --from=builder /app/public ./public
|
|
COPY --from=builder --chown=appuser:appgroup /app/.next/standalone ./
|
|
COPY --from=builder --chown=appuser:appgroup /app/.next/static ./.next/static
|
|
|
|
USER appuser
|
|
|
|
EXPOSE 3000
|
|
ENV PORT=3000
|
|
ENV HOSTNAME="0.0.0.0"
|
|
|
|
ENTRYPOINT ["dumb-init", "--"]
|
|
CMD ["node", "server.js"]
|