-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
70 lines (66 loc) · 1.56 KB
/
Dockerfile
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
FROM node:20 as base
WORKDIR /app/drc
RUN apt-get clean all
RUN apt update
RUN apt -y upgrade
RUN apt -y autoremove
RUN apt -y install nmap figlet
RUN useradd -u 1001 -U -p discordrc drc
COPY package*.json ./
RUN npm install
COPY *.js .
COPY lib ./lib/
COPY config/default.js ./config/
COPY config/local-prod.json ./config/
COPY config/channelXforms-prod.json ./config/
COPY http ./http/
COPY scripts ./scripts/
RUN chown -R drc /app/drc/scripts
ENV NODE_ENV=prod
ENV DRC_LOG_PATH=/logs
ENV DRC_IN_CONTAINER=1
ENV TZ="America/Los_Angeles"
STOPSIGNAL SIGINT
FROM base as http
COPY http.js .
ENV DRC_HTTP_PATH=/http
USER drc
CMD ["node", "http"]
FROM base as irc
COPY irc.js .
COPY irc ./irc/
COPY discord ./discord/
COPY .certs ./.certs/
RUN chown -R drc /app/drc/.certs/
USER drc
CMD ["node", "irc"]
FROM base as discord
COPY discord.js .
COPY discord ./discord/
COPY irc/numerics.js ./irc/
# zork is packaged in a snap, which does not run in containers :(
RUN apt -y install bc gnuplot colossal-cave-adventure imagemagick-6.q16
ENV PATH=/usr/games:$PATH
USER drc
CMD ["node", "discord"]
FROM node:20-alpine as prometheus
WORKDIR /app/drc
COPY package*.json ./
RUN npm install
COPY *.js .
COPY lib ./lib/
COPY config/default.js ./config/
COPY config/local-prod.json ./config/
COPY config/channelXforms-prod.json ./config/
COPY http ./http/
COPY scripts ./scripts/
COPY prometheus.js .
RUN adduser -u 1001 -D drc
RUN chown -R drc /app/drc/scripts
ENV NODE_ENV=prod
ENV DRC_LOG_PATH=/logs
ENV DRC_IN_CONTAINER=1
ENV TZ="America/Los_Angeles"
STOPSIGNAL SIGINT
USER drc
CMD ["node", "prometheus"]