This repo ships with a Dockerfile
for a postgres image you can use in
postgres-docker/Dockerfile
.
Build the docker image
docker build -t postgresql postgres-docker/
Run the docker image
docker run --rm -P --name database postgresql
Find out the port the postgres instance is running on
docker ps
In order to test the bot, you need to have a dedicated testing server.
- Click Here to use our template. This is a server template functionality provided by Discord.
- Create a bot account (guide).
- Get your bot's Client ID, replace
{ID}
with it, and then go to the URL in order to add the bot to your testing server.
https://discordapp.com/api/oauth2/authorize?client_id={ID}&permissions=8&scope=bot
Build the docker image for the bot
docker build -t discordbot .
A number of environment variables are required to run the bot. Many of these environment variables come from discord.
MOD_ID
is the id of the mod roleTALK_ID
is the id of the talk roleWG_AND_TEAMS_ID
is the id of the working groups and teams roleDISCORD_TOKEN
is the token used to connect to discordDATABASE_URL
is the url where the database is running, you will need to update the port to the port your instance of postgres is running on
Once you have your guild setup, you can run the bot
docker run -e "MOD_ID=" -e "TALK_ID=" -e "DISCORD_TOKEN=" -e "DATABASE_URL=postgres://docker:[email protected]:32768" --add-host=database:172.17.0.2 --rm -it discordbot