2024-04-06 18:56:53 -04:00
|
|
|
FROM node:latest AS build
|
2023-10-15 23:54:53 -04:00
|
|
|
|
|
|
|
WORKDIR /usr/src/bot
|
|
|
|
|
2024-09-27 13:59:47 -04:00
|
|
|
RUN apt-get update && apt-get install -y build-essential libtool autoconf automake python3
|
2023-10-15 23:54:53 -04:00
|
|
|
|
|
|
|
COPY package.json ./
|
|
|
|
|
|
|
|
COPY yarn.lock ./
|
|
|
|
|
2024-04-06 18:56:53 -04:00
|
|
|
ENV NODE_ENV production
|
|
|
|
|
2023-10-15 23:54:53 -04:00
|
|
|
RUN yarn global add node-gyp
|
|
|
|
|
2024-04-06 18:56:53 -04:00
|
|
|
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
|
2023-10-15 23:54:53 -04:00
|
|
|
|
2024-04-06 18:56:53 -04:00
|
|
|
USER node
|
2023-10-15 23:54:53 -04:00
|
|
|
|
|
|
|
WORKDIR /usr/src/bot
|
|
|
|
|
2024-04-06 18:56:53 -04:00
|
|
|
COPY --chown=node:node --from=build /usr/src/bot/node_modules ./node_modules
|
2023-10-15 23:54:53 -04:00
|
|
|
|
2024-04-06 18:56:53 -04:00
|
|
|
COPY --chown=node:node . ./
|
2023-10-15 23:54:53 -04:00
|
|
|
|
2024-04-06 18:56:53 -04:00
|
|
|
CMD ["dumb-init", "node", "bot.js"]
|