2023-02-15 01:21:36 +02:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
|
2023-02-15 03:16:04 +02:00
|
|
|
FROM node:18-alpine AS builder
|
2023-02-15 01:22:52 +02:00
|
|
|
WORKDIR /build
|
|
|
|
COPY package.json pnpm-lock.yaml ./
|
|
|
|
COPY --link scripts scripts
|
|
|
|
# install python etc so node-gyp works for the optional dependencies
|
2023-02-15 03:13:35 +02:00
|
|
|
RUN apk add --no-cache make gcc g++ python3
|
2023-02-15 01:22:52 +02:00
|
|
|
# install pnpm to make dependency installation faster (because it has a lockfile)
|
|
|
|
RUN npm install -g pnpm
|
|
|
|
# install dependencies, CI=true to skip pre/postinstall scripts
|
|
|
|
RUN CI=true pnpm install --prod --frozen-lockfile
|
|
|
|
COPY --link . .
|
2023-02-15 01:21:36 +02:00
|
|
|
|
2023-02-15 03:16:04 +02:00
|
|
|
FROM node:18-alpine AS runner
|
2023-02-15 01:21:36 +02:00
|
|
|
ENV NODE_ENV=production \
|
|
|
|
HTTP_HOST=0.0.0.0 \
|
|
|
|
HTTP_PORT=80 \
|
|
|
|
SETTINGS_HOST=127.0.0.1 \
|
|
|
|
SETTINGS_PORT=8169
|
|
|
|
WORKDIR /usr/bot
|
2023-02-15 03:17:17 +02:00
|
|
|
COPY --from=builder /build ./
|
2023-02-15 01:21:36 +02:00
|
|
|
EXPOSE ${HTTP_PORT}
|
|
|
|
ENTRYPOINT [ "/bin/sh", "/usr/bot/scripts/start.sh" ]
|