forked from Trimatix/BASED
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (25 loc) · 1.01 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
FROM python:3-slim-buster
ENV BOT_DIR /superdeckbreacker
# GCC is required to build some deps
RUN apt-get update && \
apt-get install -y gcc
# Move requiremts in alone + install first to allow better docker caching
COPY requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt && \
rm /tmp/requirements.txt
# Copy the whole bot in
COPY . $BOT_DIR
# Generate default config and place in our preferred config location
WORKDIR $BOT_DIR
RUN python3 ./makeDefaultConfig.py && \
mv ./defaultCfg.toml /config.toml && \
sed -i 's/saveData\/decks/\/decks/' /config.toml && \
sed -i 's/saveData\/logs/\/logs/' /config.toml && \
sed -i 's/bot\/cfg\/google_client_secret.json/\/google_client_secret.json/' /config.toml && \
sed -i 's/saveData/\/saveData/' /config.toml && \
sed -i 's/botToken_envVarName = ""/botToken_envVarName = "DISCORD_TOKEN"/' /config.toml && \
mkdir -p /logs
# I/O
VOLUME /decks
VOLUME /saveData
ENTRYPOINT ["python3", "-u", "./main.py", "/config.toml"]