diff --git a/README.md b/README.md index e69de29..2f2a951 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,19 @@ +# Werefox Discord Bot + +This is a Discord bot I've made in Python to use for the Discord server I'm putting together for my streams. + +## Setup + +Right now I've only tested the bot in a Docker container. The following command will build the container from the `Dockerfile` incuded and then run it. + +`sudo docker-compose up --build --force-recreate --remove-orphans -d` + +If you wish to simply run the container without re-building it, you can remove the `--build` and `--force-recreate` tags. + +`sudo docker-compose up --remove-orphans -d` + +Additionally, in most cases, `--remove-orphans` is not strictly necessary. + +## Usage + +_TODO: This section should probably point to a wiki of commands and such..._ \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index d010c74..a3e9746 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,30 +1,30 @@ --- version: "3" services: - werefox-discord-bot: - build: - context: . - dockerfile: Dockerfile - image: werefox-discord-bot:latest - container_name: wdb_container_service - restart: always - links: - - postgres - volumes: - - ./volumes/python/lib:/home/werefox/lib - - ./volumes/python/data:/home/werefox/data - postgres: - image: postgres:13 - restart: always - ports: - - 8131:8131 - volumes: - - ./volumes/postgres/pg_data:/var/lib/postgresql/data/pg_data - - ./volumes/postgres/config:/config - environment: - POSTGRES_PASSWORD_FILE: /config/pgdb.key - POSTGRES_DB: werefox_prod - POSTGRES_USER: werefox - POSTGRES_HOST: localhost - POSTGRES_PORT: 8131 - PGDATA: /var/lib/postgresql/data/pg_data + werefox-discord-bot: + build: + context: . + dockerfile: Dockerfile + image: werefox-discord-bot:latest + container_name: wdb_container_service + restart: always + links: + - postgres + volumes: + - ./volumes/python/lib:/home/werefox/lib + - ./volumes/python/data:/home/werefox/data + postgres: + image: postgres:13 + restart: always + ports: + - 8131:8131 + volumes: + - ./volumes/postgres/pg_data:/var/lib/postgresql/data/pg_data + - ./volumes/postgres/config:/config + environment: + POSTGRES_PASSWORD_FILE: /config/pgdb.key + POSTGRES_DB: werefox_prod + POSTGRES_USER: werefox + POSTGRES_HOST: localhost + POSTGRES_PORT: 8131 + PGDATA: /var/lib/postgresql/data/pg_data diff --git a/werefox_discord_bot.py b/werefox_discord_bot.py index 67d83bb..06cf773 100644 --- a/werefox_discord_bot.py +++ b/werefox_discord_bot.py @@ -1,5 +1,9 @@ #!/bin/python -from lib.werefox_bot_runtime import run +from asyncio import sleep, run +try: + from volumes.python.lib.werefox_bot_runtime import run as werefox_run +except: + from lib.werefox_bot_runtime import run as werefox_run -run() +werefox_run()