-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
46 lines (44 loc) · 1.34 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
44
45
46
version: "3.8"
services:
db:
image: postgres:latest
environment:
- POSTGRES_USER=${POSTGRES_USER}
- PGUSER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=buffalobot
- POSTGRES_INITDB_SCRIPT=/app/db/init.sql
volumes:
- type: volume
source: database
target: /var/lib/postgresql/data
- type: bind
source: ./db/init.sql
target: /docker-entrypoint-initdb.d/init.sql
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "psql -U ${POSTGRES_USER} -d buffalobot -c 'SELECT 1;'"]
interval: 10s
retries: 5
restart: unless-stopped
bot:
image: ${IMAGE_NAME}:${TAG}
build: .
command: bash -c "alembic upgrade head && python3 /app/main.py"
environment:
- POSTGRES_HOST=${POSTGRES_HOST}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- DISCORD_TOKEN_KEY=${DISCORD_TOKEN_KEY}
volumes:
- type: volume
source: logs
target: /app/logs
depends_on:
db:
condition: service_healthy
restart: always
volumes:
database:
logs: