Skip to content
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

Support using docker for your bot #4

Open
wants to merge 1 commit into
base: master
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
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM python:3.7-buster

COPY . /app
WORKDIR /app

RUN pip3 install -r requirements.txt
CMD python3 ./ssdb.py
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ Creates a list of Source engine game servers and updates it regularly. Useful fo
## Instructions
- Make sure you have Python 3 installed and in your PATH.
- Run `pip install -r requirements.txt`
- Configure `.ssdb_config.ini` (remove .template from name) with at least the bot token, channel id and the list method
- Configure `config/.ssdb_config.ini` (remove .template from name) with at least the bot token, channel id and the list method
- Run `run.bat` or `run.sh`

**Docker Instructions (Optional)**:
- Make sure you have Docker and `docker-compose` in your PATH
- Run (docker) `docker-compose up --build` or `docker-compose up -d`
File renamed without changes.
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3'

services:
ssdb:
restart: always
build: ./
volumes:
- ./config:/app/config
2 changes: 1 addition & 1 deletion ssdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ def check_update_loop(self):
# Read our config
config = configparser.ConfigParser()
config_name = path.join(
path.dirname(__file__), ".ssdb_config.ini")
path.dirname(__file__), "config/.ssdb_config.ini")
with open(config_name, 'r') as fp:
config.read_file(fp)

Expand Down