feat(docker): add non-root user, labels, and healthcheck (closes #433)

Now works with Pterodactyl.
This commit is contained in:
Isaac
2023-06-15 00:21:52 +01:00
parent faddacc6df
commit bd42781878
5 changed files with 27 additions and 6 deletions

View File

@@ -14,10 +14,19 @@ RUN CI=true pnpm install --prod --frozen-lockfile
COPY --link . .
FROM node:18-alpine AS runner
ENV NODE_ENV=production \
RUN adduser --disabled-password --home /home/container container
USER container
ENV USER=container \
HOME=/home/container \
NODE_ENV=production \
HTTP_HOST=0.0.0.0 \
HTTP_PORT=80
WORKDIR /usr/bot
WORKDIR /home/container
COPY --from=builder /build ./
EXPOSE ${HTTP_PORT}
ENTRYPOINT [ "/usr/bot/scripts/start.sh" ]
EXPOSE ${HTTP_PORT}/tcp
ENTRYPOINT [ "/home/container/scripts/start.sh" ]
HEALTHCHECK --interval=15s --timeout=5s --start-period=60s \
CMD curl -f http://localhost:${HTTP_PORT}/status || exit 1
LABEL org.opencontainers.image.source=https://github.com/discord-tickets/bot \
org.opencontainers.image.description="The most popular open-source ticket bot for Discord." \
org.opencontainers.image.licenses="GPL-3.0-or-later"