From 8c7648d330eae3497e01a2e812ba46d3edb41401 Mon Sep 17 00:00:00 2001 From: Steven Noack <147175134+MacStenk@users.noreply.github.com> Date: Thu, 11 Dec 2025 06:32:28 +0100 Subject: [PATCH] Refactor Dockerfile for Node 18 and pnpm Updated Dockerfile to use Node 18-alpine and streamline build process. --- Dockerfile | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index d2ac013..70bf5b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,34 +1,28 @@ -FROM node:20.11-bullseye AS build +FROM node:18-alpine + +# Install pnpm +RUN npm install -g pnpm WORKDIR /app -# Copy package files and install dependencies -COPY package*.json ./ -RUN pnpm install +# Copy package files +COPY package.json pnpm-lock.yaml ./ -# Copy application files +# Install dependencies +RUN pnpm install --frozen-lockfile + +# Copy source COPY . . -# Generate prisma client and build the application +# Build +RUN pnpm run build + +# Run prisma migrations RUN npx prisma generate -RUN npm run build -# Runtime stage -FROM node:20.11-alpine as runtime - -WORKDIR /app - -RUN apk update && \ - apk add --no-cache openssl && \ - rm -rf /var/cache/apk/* - -# Copy built files from the build stage -COPY --from=build /app . - -# Install only runtime dependencies -RUN npm install --only=production +# Create config directory +RUN mkdir -p /app/config EXPOSE 3000 -ENTRYPOINT [ "node", "./dist/index.js" ] -CMD ["start"] +CMD ["node", "dist/index.js"]