Skip to content

Commit ce15305

Browse files
committed
chore: merge main into release for new releases
2 parents 6d9d764 + 49972e6 commit ce15305

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

apps/api/Dockerfile.multistage

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ RUN cd apps/api && bunx nest build
6060
# =============================================================================
6161
# STAGE 3: Production Runtime
6262
# =============================================================================
63-
FROM node:20-alpine AS production
63+
FROM node:20-slim AS production
6464

6565
WORKDIR /app
6666

6767
# Install runtime dependencies
68-
RUN apk add --no-cache wget libc6-compat openssl
68+
RUN apt-get update && apt-get install -y --no-install-recommends wget openssl && rm -rf /var/lib/apt/lists/*
6969

7070
# Copy built NestJS app
7171
COPY --from=builder /app/apps/api/dist ./dist
@@ -91,12 +91,11 @@ COPY --from=builder /app/node_modules ./node_modules
9191
ENV NODE_ENV=production
9292
ENV PORT=3333
9393

94-
# Install Prisma CLI and regenerate client in production stage
95-
RUN npm install -g prisma@6.18.0 && \
96-
prisma generate --schema=./prisma/schema.prisma
94+
# Regenerate Prisma client for this runtime environment
95+
RUN npx prisma generate --schema=./prisma/schema.prisma
9796

9897
# Create non-root user
99-
RUN addgroup --system nestjs && adduser --system --ingroup nestjs nestjs \
98+
RUN groupadd --system nestjs && useradd --system --gid nestjs nestjs \
10099
&& chown -R nestjs:nestjs /app
101100

102101
USER nestjs
@@ -107,5 +106,5 @@ EXPOSE 3333
107106
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
108107
CMD wget --no-verbose --tries=1 --spider http://localhost:3333/v1/health || exit 1
109108

110-
# Start the application
111-
CMD ["node", "dist/src/main.js"]
109+
# Start the application with crash diagnostics
110+
CMD ["node", "--report-on-fatalerror", "--report-compact", "dist/src/main.js"]

0 commit comments

Comments
 (0)