qrm2/README-DOCKER.md
Abigail G 090b96482d
update docker documentation to mention github registry
also corrected a couple errors
fixes #212
2020-09-24 00:14:45 -04:00

3.1 KiB

Docker help for qrm2

You have multiple ways to use docker to run an instance of qrm2.

This is the easiest method for running the bot without any modifications.
Do not clone the repository when using this method!

  1. Create a new directory and cd into it.

  2. Create the docker-compose.yml file:

    version: '3'
    services:
      qrm2:
        image: "classabbyamp/qrm2:latest"
        # OR
        # image: "docker.pkg.github.com/miaowware/qrm2/qrm2:latest"
        restart: on-failure
        volumes:
          - "./data:/app/data:rw"
        environment:
          - PYTHONUNBUFFERED=1
    

    Note that there are two possible sources for the image: docker's and github's registry. Github's registry requires a few extra steps during the initial setup.

  3. Create a subdirectory named data.

  4. Copy the templates for options.py and keys.py to data/, and edit them.

  5. Run docker-compose:

    $ docker-compose pull
    $ docker-compose up -d
    

    Run without "-d" to test the bot. (run in foreground)

Using docker-compose and building the image

This is the easiest method to run the bot with modifications.

  1. cd into the repository.

  2. Create the docker-compose.yml file:

    version: '3'
    services:
      qrm2:
        build: .
        image: "qrm2:local-latest"
        restart: on-failure
        volumes:
          - "./data:/app/data:rw"
        environment:
          - PYTHONUNBUFFERED=1
    
  3. Create a subdirectory named data.

  4. Copy the templates for options.py and keys.py to data/, and edit them.

  5. Run docker-compose:

    $ docker-compose build --pull
    $ docker-compose up -d
    

    Run without "-d" to test the bot. (run in foreground)

Using pure docker

This methods is not very nice to use.
I just wanna run the darn thing, not do gymnastics!

[Optional] Building the image

  1. cd into the repository.

  2. Run docker build:

    $ docker build -t qrm2:local-latest .
    

Creating the container

  1. Be in a directory with a data/ subdirectory, which should contain valid options.py and keys.py files (copy and edit the templates).

  2. Run the container:

    $ docker run -d --rm --mount type=bind,src=$(pwd)/data,dst=/app/data --name qrm2 [image]
    

    Where [image] is either of:

    • discord-qrm2:local-latest if you are building your own.
    • classabbyamp/discord-qrm2:latest if you want to use the prebuilt image.