Skip to content
This repository has been archived by the owner on Jan 19, 2025. It is now read-only.

Commit

Permalink
ci(docker): drastically reduce image size
Browse files Browse the repository at this point in the history
  • Loading branch information
louisgrasset committed Nov 29, 2023
1 parent 3543ff8 commit cfd559d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
FROM node:lts

RUN groupadd --system bot \
&& useradd --system bot -g bot
FROM node:lts-alpine

WORKDIR /app

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"

0 comments on commit cfd559d

Please sign in to comment.