From 81fa18053d08c8ced555d35e585de4275dae354b Mon Sep 17 00:00:00 2001 From: Matthias Nannt Date: Mon, 19 Dec 2022 09:13:07 +0100 Subject: [PATCH] update dockerfile from alpine to slim to fix openssl errors --- apps/hq/Dockerfile | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/apps/hq/Dockerfile b/apps/hq/Dockerfile index 7ec059402e..33a49cfc52 100644 --- a/apps/hq/Dockerfile +++ b/apps/hq/Dockerfile @@ -1,8 +1,6 @@ -# Add lockfile and package.json's of isolated subworkspace -FROM node:16-alpine AS installer -RUN apk update -RUN apk --no-cache add curl libc6-compat -RUN curl -fsSL "https://github.com/pnpm/pnpm/releases/latest/download/pnpm-linuxstatic-x64" -o /bin/pnpm; chmod +x /bin/pnpm; +FROM node:18-slim AS installer +RUN npm install -g pnpm + WORKDIR /app # First install the dependencies (as they change less often) @@ -16,10 +14,8 @@ RUN pnpm install RUN pnpm dlx prisma generate RUN pnpm turbo run build --filter=hq... -FROM node:16-alpine AS runner - -RUN apk --no-cache add curl libc6-compat -RUN curl -fsSL "https://github.com/pnpm/pnpm/releases/latest/download/pnpm-linuxstatic-x64" -o /bin/pnpm; chmod +x /bin/pnpm; +FROM node:18-slim AS runner +RUN npm install -g pnpm # Don't run production as root RUN addgroup --system --gid 1001 nodejs @@ -31,7 +27,7 @@ WORKDIR /home/nextjs COPY --from=installer /app/apps/hq/next.config.js . COPY --from=installer /app/apps/hq/package.json . -# Automatically leverage output traces to reduce image size +# Automatically leverage output traces to reduce image size # https://nextjs.org/docs/advanced-features/output-file-tracing COPY --from=installer --chown=nextjs:nodejs /app/apps/hq/.next/standalone ./ COPY --from=installer --chown=nextjs:nodejs /app/apps/hq/.next/static ./apps/hq/.next/static