update dockerfile from alpine to slim to fix openssl errors

This commit is contained in:
Matthias Nannt
2022-12-19 09:13:07 +01:00
parent c256bab985
commit 81fa18053d

View File

@@ -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