setup Docker

This commit is contained in:
Benjamin Schmid 2020-03-28 21:57:24 +01:00
parent 475a41abcc
commit 9f882ab1be
6 changed files with 39 additions and 13 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
secrets.env
.env
venv

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM python:3.8-alpine3.10
WORKDIR /app
RUN apk add build-base
COPY requirements.txt ./
RUN pip install -r requirements.txt
COPY src/ ./src/
CMD ["python3", "src/werewolve-bot.py"]

8
docker-compose.yml Normal file
View File

@ -0,0 +1,8 @@
version: "3.7"
services:
werewolf:
build: .
image: werwewolf
env_file: secrets.env
restart: always

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
discord.py
python-dotenv

View File

@ -7,6 +7,9 @@ from dotenv import load_dotenv
load_dotenv() load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN') TOKEN = os.getenv('DISCORD_TOKEN')
if TOKEN is None:
print("Missing discord token!")
exit(1)