revert 0e7c9dd890
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m21s

revert experimental smaller docker image
This commit is contained in:
2026-03-20 02:23:15 +00:00
parent 0e7c9dd890
commit 84aa69884d
+11 -28
View File
@@ -1,40 +1,23 @@
FROM node:20-alpine AS base FROM node:20-alpine
WORKDIR /app
# Required for Prisma on Alpine
RUN apk add --no-cache openssl RUN apk add --no-cache openssl
# ── deps: install production deps only ─────────────────────────────────────── # Install all deps (including devDeps for tsx worker runtime + build tooling)
FROM base AS deps
WORKDIR /app
COPY package*.json ./
COPY prisma ./prisma
RUN npm ci --omit=dev && npm run postinstall
# ── build: full install + compile ─────────────────────────────────────────────
FROM base AS builder
WORKDIR /app
COPY package*.json ./ COPY package*.json ./
COPY prisma ./prisma COPY prisma ./prisma
RUN npm ci RUN npm ci
# Copy source
COPY . . COPY . .
# Generate Prisma client and build Next.js (postinstall handles prisma generate)
RUN npm run build RUN npm run build
# ── runner: lean production image ─────────────────────────────────────────────
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production ENV NODE_ENV=production
# Prisma client + schema (needed at runtime for db push and queries)
COPY --from=deps /app/node_modules ./node_modules
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/next.config.mjs ./next.config.mjs
COPY --from=builder /app/prisma ./prisma
# Worker source (compiled to node_modules/.cache or run via tsx in prod)
COPY --from=builder /app/src/worker ./src/worker
COPY --from=builder /app/src/lib ./src/lib
COPY --from=builder /app/tsconfig.json ./tsconfig.json
EXPOSE 3000 EXPOSE 3000
# Default: web server. Worker container overrides CMD. # Default: run web server. Worker container overrides this CMD.
CMD ["npm", "start"] CMD ["npm", "start"]