Initial readme, minor formatting changes.

This commit is contained in:
Alexis Werefox 2021-08-29 23:28:25 +00:00
parent 8ab883d0b9
commit d4fd8c9519
3 changed files with 52 additions and 29 deletions

View file

@ -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..._

View file

@ -1,30 +1,30 @@
--- ---
version: "3" version: "3"
services: services:
werefox-discord-bot: werefox-discord-bot:
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
image: werefox-discord-bot:latest image: werefox-discord-bot:latest
container_name: wdb_container_service container_name: wdb_container_service
restart: always restart: always
links: links:
- postgres - postgres
volumes: volumes:
- ./volumes/python/lib:/home/werefox/lib - ./volumes/python/lib:/home/werefox/lib
- ./volumes/python/data:/home/werefox/data - ./volumes/python/data:/home/werefox/data
postgres: postgres:
image: postgres:13 image: postgres:13
restart: always restart: always
ports: ports:
- 8131:8131 - 8131:8131
volumes: volumes:
- ./volumes/postgres/pg_data:/var/lib/postgresql/data/pg_data - ./volumes/postgres/pg_data:/var/lib/postgresql/data/pg_data
- ./volumes/postgres/config:/config - ./volumes/postgres/config:/config
environment: environment:
POSTGRES_PASSWORD_FILE: /config/pgdb.key POSTGRES_PASSWORD_FILE: /config/pgdb.key
POSTGRES_DB: werefox_prod POSTGRES_DB: werefox_prod
POSTGRES_USER: werefox POSTGRES_USER: werefox
POSTGRES_HOST: localhost POSTGRES_HOST: localhost
POSTGRES_PORT: 8131 POSTGRES_PORT: 8131
PGDATA: /var/lib/postgresql/data/pg_data PGDATA: /var/lib/postgresql/data/pg_data

View file

@ -1,5 +1,9 @@
#!/bin/python #!/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()