You have multiple options to run an instance of {{bot}} using docker.
This is the easiest method to run the bot with modifications.
-
cd
into the repository. -
Create the
docker-compose.yml
file:version: '3' services: {{bot}}: build: . image: "{{image}}:local-latest" restart: on-failure volumes: - "./data:/app/data:rw" environment: - PYTHONUNBUFFERED=1
-
Create a subdirectory named
data
. -
Copy the templates for
options.py
andkeys.py
todata/
, and edit them. -
Run
docker-compose
:$ docker-compose build --pull $ docker-compose -d
Run without "-d" to test the bot. (run in foreground)
This methods is not very nice to use.
I just wanna run the darn thing, not do gymnastics!
-
cd
into the repository. -
Run docker build:
$ docker build -t {{image}}:local-latest .
-
Be in a directory with a
data/
subdirectory, which should contain validoptions.py
andkeys.py
files (copy and edit the templates). -
Run the container:
$ docker run -d --rm --mount type=bind,src=$(pwd)/data,dst=/app/data --name {{bot}} [image]
Where
[image]
is either of:{{image}}:local-latest
if you are building your own.