From daae9deaf26624fc9176f98942653fd745faf0a5 Mon Sep 17 00:00:00 2001 From: simonlary Date: Mon, 1 Jan 2024 21:24:29 -0500 Subject: [PATCH] Use alpine and production dependencies, but cleanup build dependencies afterward. --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7a8662e..187fea7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,9 @@ FROM node:20-alpine WORKDIR /app ENV NODE_ENV=production COPY package*.json ./ -RUN npm ci +# We need to install `alpine-sdk` and `python3` to build `@discordjs/opus` +RUN apk add --no-cache --virtual .build-deps alpine-sdk python3 \ + && npm ci --production \ + && apk del .build-deps COPY --from=builder /app/out ./out CMD [ "node", "out/index.js" ]