Skip to content

Commit e84a6dc

Browse files
authored
Merge pull request #3 from judge0/feature/docker-support
Docker support
2 parents badb7f2 + a38fda2 commit e84a6dc

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.*
2+
Dockerfile
3+
README.md
4+
docker-compose.yml

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM python:3.7-alpine
2+
RUN pip install --no-cache-dir pipenv
3+
4+
WORKDIR /bot
5+
6+
COPY Pipfile* ./
7+
RUN pipenv install
8+
9+
COPY . .
10+
11+
CMD ["pipenv", "run", "start"]
12+
13+
LABEL maintainer="Herman Zvonimir Došilović, hermanz.dosilovic@gmail.com"
14+
LABEL version="1.0.0"

bot/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020
bot.load_extension("bot.cogs.information")
2121

2222
# run the bot with the token or enviroment variable
23-
token = sys.argv[1] if sys.argv[1] else os.environ["BOT_TOKEN"]
23+
token = sys.argv[1] if len(sys.argv) > 2 else os.environ["BOT_TOKEN"]
2424
bot.run(token)

docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: '2'
2+
services:
3+
bot:
4+
image: judge0/discord-bot:1.0.0
5+
environment:
6+
- BOT_TOKEN=
7+
restart: always

0 commit comments

Comments
 (0)