-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
32 lines (27 loc) · 1001 Bytes
/
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
FROM node:14-alpine
# Dependencies
RUN apk add --update curl alpine-sdk bash libtool autoconf automake libsodium g++
RUN apk add nodejs git ffmpeg espeak yarn python3
RUN npm install -g node-gyp@latest
# Prepare /app
RUN mkdir /app
WORKDIR /app
COPY package.json yarn.lock .git /app/
# --- Build and run ---
RUN mkdir -p /app/build /app/public
# Choose which .env to use.
COPY .env.DEBUG /app/.env
COPY heart.png generate_secrets.sh HELP.md lib \
clone_nocheckout.sh tsconfig.json tslint.json \
web bot.json /app/
# Install deps
COPY lib/drug-o-matic /app/lib/drug-o-matic
RUN yarn install
# Build
RUN cp /app/bot.json /app/generate_secrets.sh /app/HELP.md /app/package.json /app/build/
RUN /app/node_modules/.bin/tsc -b /app/tsconfig.json
# Run
ENTRYPOINT ["sh", "-c", "source /app/.env && \"$@\"", "-s"]
# Kill with `docker stop` for a graceful shutdown (saving configs, etc.)
# or use `docker kill` to not follow the bot's shutdown procedur.
CMD ["node", ".", "--unhandled-rejections=none"]