Skip to content

Docker‐compose example

Mike DeVita edited this page Jul 28, 2023 · 3 revisions

Purpose

outline how to run the onairdiscordbot using the latest docker image, using docker-compose.

Create a new file, docker-compose.yml using the example provided below, replacing each environment variable's example value with the correct value.

You will need to:

  1. Obtain the required OnAir Key's, see this wiki for more info
  2. Register a new bot and with Discord via their developer portal, see this wiki for more info
    • Keep note of the ApplicationID and the Token

Starting

  • docker-compose up -d, -d is detached mode

Stopping

  • docker-compose down

Viewing logs

  • docker-compose logs -f show latest log and follow it
  • docker-compose logs to view latest log snapshot

docker-compose.yml

version: '3'
services:
  bot:
    image: mikedevita/onairdiscordbot:latest
    container_name: onairdiscordbot
    # use external .env file
    env_file: .env
    # or pass environment variables
    # directly in by defining them like so
    # environment:
    #   DISCORD_TOKEN: '###_REPLACE_WITH_YOUR_DATA_###'
    #   DISCORD_CLIENTID: '###_REPLACE_WITH_YOUR_DATA_###'
    #   DISCORD_GUILDID: '###_REPLACE_WITH_YOUR_DATA_###'
    #   DISCORD_OWNER: '###_REPLACE_WITH_YOUR_DATA_###'
    #   DISCORD_CHANNEL: '###_REPLACE_WITH_YOUR_DATA_###'
    #   DISCORD_ONCONNECTNOTICE: '###_REPLACE_WITH_YOUR_DATA_###'
    #   DISCORD_DEPLOYCOMMANDS: '###_REPLACE_WITH_YOUR_DATA_###'
    #   ONAIR_COMPANYID: '###_REPLACE_WITH_YOUR_DATA_###'
    #   ONAIR_VAID: 'true'
    #   ONAIR_APIKEY: 'true'
    #   LOGLEVEL: 'info'
    #   LOG_TO_CONSOLE: 'true'

Clone this wiki locally