File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 11# Use Node.js runtime for production
22FROM node:20-alpine
33
4- # Install wget for health check
5- RUN apk add --no-cache wget
4+ # Install required packages ( wget for healthcheck, curl/bash for bun install, libc compat for prisma)
5+ RUN apk add --no-cache wget curl bash libc6-compat openssl
66
77WORKDIR /app
88
9- # Copy the entire pre-built bundle (no dependencies needed)
9+ # Copy manifests first and install production deps inside the image (avoid broken bun symlinks)
10+ COPY package.json bun.lock ./
11+
12+ # Install bun and deps
13+ RUN curl -fsSL https://bun.sh/install | bash \
14+ && export PATH="/root/.bun/bin:$PATH" \
15+ && bun install --production --frozen-lockfile --ignore-scripts
16+
17+ # Now copy the pre-built app contents (dist/, prisma/, etc.)
1018COPY . .
1119
1220# Set environment variables
1321ENV NODE_ENV=production
1422ENV PORT=3333
1523
1624# Create a non-root user for security
17- RUN addgroup --system nestjs && adduser --system --ingroup nestjs nestjs
18-
19- # Change ownership to nestjs user
20- RUN chown -R nestjs:nestjs /app
25+ RUN addgroup --system nestjs && adduser --system --ingroup nestjs nestjs \
26+ && chown -R nestjs:nestjs /app
2127
2228USER nestjs
2329
Original file line number Diff line number Diff line change @@ -66,8 +66,7 @@ phases:
6666 - ' [ -f "../docker-build/src/main.js" ] || { echo "❌ main.js not found in docker-build/src"; exit 1; }'
6767
6868 # Copy entire node_modules for runtime (includes @trycompai/db from npm)
69- - echo "Bundling all runtime dependencies..."
70- - cp -r ../../node_modules ../docker-build/
69+ - echo "Skipping host node_modules copy; Dockerfile installs prod deps inside image"
7170
7271 # Copy Dockerfile
7372 - echo "Copying Dockerfile..."
You can’t perform that action at this time.
0 commit comments