DiscordTickets/Dockerfile

24 lines
730 B
Docker
Raw Normal View History

# syntax=docker/dockerfile:1
2023-02-15 03:16:04 +02:00
FROM node:18-alpine AS builder
WORKDIR /build
# 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
# install pnpm to make dependency installation faster (because it has a lockfile)
RUN npm install -g pnpm
COPY package.json pnpm-lock.yaml ./
COPY --link scripts scripts
# install dependencies, CI=true to skip pre/postinstall scripts
RUN CI=true pnpm install --prod --frozen-lockfile
2023-03-11 17:03:11 +02:00
RUN chmod +x /usr/bot/scripts/start.sh
COPY --link . .
2023-02-15 03:16:04 +02:00
FROM node:18-alpine AS runner
ENV NODE_ENV=production \
HTTP_HOST=0.0.0.0 \
2023-03-11 17:03:11 +02:00
HTTP_PORT=80
WORKDIR /usr/bot
2023-02-15 03:17:17 +02:00
COPY --from=builder /build ./
EXPOSE ${HTTP_PORT}
2023-03-11 17:03:11 +02:00
ENTRYPOINT [ "/usr/bot/scripts/start.sh" ]