Skip to content

add docker files #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3-alpine
LABEL maintainer="Thijs Eilander <[email protected]>"

COPY bootstrap.sh /bootstrap.sh

RUN set -x; \
\
pip install --upgrade pip ;\
apk add --no-cache --virtual .build-deps \
git \
;\
\
cd / ;\
/usr/bin/git clone https://github.com/Reloisback/Whiteout-Survival-Discord-Bot.git app ;\
cd /app ;\
echo 0 > bot_token.txt ;\
sh -c 'echo y' | python main.py 2>/dev/null ;\
rm bot_token.txt ;\
apk del .build-deps ;\
chmod +x /bootstrap.sh

WORKDIR /app
ENTRYPOINT ["/bootstrap.sh"]
17 changes: 17 additions & 0 deletions docker/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

echo "[WSDB] For more information please see https://github.com/Reloisback/Whiteout-Survival-Discord-Bot"

cd /app


if [ ! -n "${DISCORD_BOT_TOKEN}" ]; then
echo "please set DISCORD_BOT_TOKEN"
exit
fi

if [ -n "${DISCORD_BOT_TOKEN}" ]; then
echo "${DISCORD_BOT_TOKEN}" > bot_token.txt
fi

sh -c 'echo y' | python main.py
8 changes: 8 additions & 0 deletions docker/docker-compose.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
wos-discord-bot:
image: eilandert/whiteout-survival-discord-bot:v4
container_name: wos-discord-bot
volumes:
- /opt/docker/wos/db/:/app/db
restart: unless-stopped
environment:
- DISCORD_BOT_TOKEN=<your bot token here>