Changed to node18 slim

This commit is contained in:
BE-CH 2023-08-03 21:51:01 +02:00
parent 3572df0a09
commit e7ff20fbfb

View file

@ -1,7 +1,10 @@
# Install dependencies only when needed
FROM node:18-alpine AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
FROM node:18-slim AS deps
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y openssl
WORKDIR /app
COPY package.json yarn.lock ./
# Add yarn timeout to handle slow CPU when Github Actions
@ -9,7 +12,7 @@ RUN yarn config set network-timeout 300000
RUN yarn install --frozen-lockfile
# Rebuild the source code only when needed
FROM node:18-alpine AS builder
FROM node:18-slim AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY docker/middleware.js .
@ -26,7 +29,7 @@ ENV NEXT_TELEMETRY_DISABLED 1
RUN yarn build-docker
# Production image, copy all the files and run next
FROM node:18-alpine AS runner
FROM node:18-slim AS runner
WORKDIR /app
ENV NODE_ENV production