aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Dockerfile22
1 files changed, 15 insertions, 7 deletions
diff --git a/Dockerfile b/Dockerfile
index be11515..4e76020 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,23 +1,31 @@
-FROM node:alpine AS build
+FROM node:latest AS build
WORKDIR /usr/src/bot
-RUN apk add --update alpine-sdk libtool autoconf automake python3
+RUN apt-get update && apt-get install -y build-essential libtool autoconf automake python3
COPY package.json ./
COPY yarn.lock ./
+ENV NODE_ENV production
+
RUN yarn global add node-gyp
-RUN yarn install
+RUN yarn install --production
+
+FROM node:21.7.2-bookworm-slim
+
+ENV NODE_ENV production
+
+RUN apt-get update && apt-get install -y dumb-init
-FROM node:alpine
+USER node
WORKDIR /usr/src/bot
-COPY --from=build /usr/src/bot/node_modules ./node_modules
+COPY --chown=node:node --from=build /usr/src/bot/node_modules ./node_modules
-COPY . ./
+COPY --chown=node:node . ./
-CMD ["node", "bot.js"]
+CMD ["dumb-init", "node", "bot.js"]