From cfd559d303ac80976682f023495771ca764e52fe Mon Sep 17 00:00:00 2001 From: Louis Grasset Date: Wed, 29 Nov 2023 03:25:27 +0100 Subject: [PATCH] ci(docker): drastically reduce image size --- Dockerfile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index aa5eeef..871de49 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,4 @@ -FROM node:lts - -RUN groupadd --system bot \ - && useradd --system bot -g bot +FROM node:lts-alpine WORKDIR /app @@ -9,11 +6,10 @@ COPY src/ /app/src COPY scripts/ /app/scripts COPY package.json package-lock.json tsconfig.json .eslintrc.json /app/ -RUN npm run prebuild -RUN npm ci --ignore-scripts && npm rebuild --platform=linux --arch=x64 --libc=glibc sharp && npm run build +RUN npm ci --ignore-scripts && npm rebuild --platform=linux --arch=x64 --libc=musl sharp && npm run build --ignore-scripts RUN echo "" > .env -USER bot +USER node CMD node /app/dist/index.js "$ENV_FILE"