DiscordTickets/Dockerfile
Isaac e6bce8b331
feat(docker): add new Dockerfile
Co-authored-by: Uzurka <101745008+Uzurka@users.noreply.github.com>
2023-02-14 23:21:36 +00:00

32 lines
810 B
Docker

# syntax=docker/dockerfile:1
FROM node:18-alpine
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
COPY package.json pnpm-lock.yaml ./
COPY --link scripts scripts
# install python etc so node-gyp works for the optional dependencies
RUN apk add --no-cache --virtual .build-deps make gcc g++ python3 \
# install pnpm to make dependency installation faster (because it has a lockfile)
&& npm install -g pnpm \
# install dependencies, CI=true to skip pre/postinstall scripts
&& CI=true pnpm install --prod --frozen-lockfile \
# pnpm isn't needed now
&& npm uninstall pnpm --global \
# remove node-gyp stuff
&& apk del .build-deps
COPY --link . .
EXPOSE ${HTTP_PORT}
ENTRYPOINT [ "/bin/sh", "/usr/bot/scripts/start.sh" ]