forked from discord-tickets/bot
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (33 loc) · 1.25 KB
/
Dockerfile
File metadata and controls
49 lines (33 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# syntax=docker/dockerfile:1
FROM node:22-alpine3.20 AS builder
# install required depencencies for node-gyp
RUN apk add --no-cache make gcc g++ python3
RUN npm install -g pnpm
WORKDIR /build
COPY --link scripts scripts
RUN chmod +x ./scripts/start.sh
COPY package.json pnpm-lock.yaml ./
RUN CI=true pnpm install --prod --frozen-lockfile
COPY --link . .
FROM node:22-alpine3.20 AS runner
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"
RUN apk --no-cache add curl
RUN adduser --disabled-password --home /home/container container
RUN mkdir /app \
&& chown container:container /app \
&& chmod -R 777 /app
RUN mkdir -p /home/container/user /home/container/logs \
&& chown -R container:container /home/container
USER container
ENV USER=container \
HOME=/home/container \
NODE_ENV=production \
HTTP_HOST=0.0.0.0 \
DOCKER=true
WORKDIR /home/container
COPY --from=builder --chown=container:container --chmod=777 /build /app
ENTRYPOINT [ "/app/scripts/start.sh" ]
HEALTHCHECK --interval=15s --timeout=5s --start-period=60s \
CMD curl -f http://localhost:${HTTP_PORT}/status || exit 1