-
Notifications
You must be signed in to change notification settings - Fork 10
/
docker-compose.yml
43 lines (40 loc) · 1.35 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
version: '3'
services:
# This is the Bot!
bot:
container_name: "nexus-mods-bot"
# build from the Dockerfile
build: .
image: nexus-mods-bot
# ports to expose to your machine (and others) -
# again, overwrites the Dockerfile so you can run it on other ports locally if you choose.
# e.g: "port to access on your machine:port the container is exposing"
ports:
- "80:80"
volumes:
- ./:/bot/
# links your bot to the database (networking wise)
links:
- postgres
# Make sure your database starts up before the bot
# Word of caution: this only makes the container start first, it doesn't wait until the container has finished starting up.
depends_on:
- postgres
# This builds you a database
postgres:
image: postgres:12
environment:
# This is the user your bot will login to the database with
POSTGRES_USER: postgres
# This is the database name which will get created automagically for you.
POSTGRES_DB: discord_bot
# This is the port the database will use to communicate on.
POSTGRES_PORT: '5432'
# ports to expose to your machine (and others)
ports:
- "5432:5432"
# This allows the database to keep its data between being destroyed and re-created
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
postgres_data: