Files
at-mintel/packages/infra/docker/Dockerfile.gatekeeper
Marc Mintel 646d615e76
All checks were successful
Monorepo Pipeline / 🧪 Quality Assurance (push) Successful in 2m29s
Monorepo Pipeline / 🚀 Release (push) Successful in 2m28s
Monorepo Pipeline / 🐳 Build & Push Images (push) Successful in 7m4s
fix(gatekeeper): ensure public directory exists in Dockerfile to prevent COPY failure
2026-02-04 22:15:44 +01:00

38 lines
1.1 KiB
Docker

# Step 1: Builder stage
FROM node:20-alpine AS builder
RUN apk add --no-cache libc6-compat curl
WORKDIR /app
RUN corepack enable pnpm
# Copy source (honoring .dockerignore)
COPY . .
# Use a secret for NPM_TOKEN to authenticate with private registry
RUN --mount=type=cache,target=/root/.local/share/pnpm/store/v3 \
--mount=type=secret,id=NPM_TOKEN \
export NPM_TOKEN=$(cat /run/secrets/NPM_TOKEN) && \
pnpm i --frozen-lockfile
# Build Gatekeeper and its dependencies
RUN pnpm --filter @mintel/gatekeeper... build
RUN mkdir -p packages/gatekeeper/public
# Step 2: Runner stage
FROM node:20-alpine AS runner
RUN apk add --no-cache libc6-compat curl
WORKDIR /app
ENV NODE_ENV=production
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=builder /app/packages/gatekeeper/public ./packages/gatekeeper/public
COPY --from=builder /app/packages/gatekeeper/.next/standalone ./
COPY --from=builder /app/packages/gatekeeper/.next/static ./packages/gatekeeper/.next/static
USER nextjs
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["node", "packages/gatekeeper/server.js"]