forked from Ballsdex-Team/BallsDex-DiscordBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
115 lines (107 loc) · 2.71 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
x-common-env-vars:
- &postgres-db
POSTGRES_DB=ballsdex
- &postgres-user
POSTGRES_USER=ballsdex
- &postgres-url
"BALLSDEXBOT_DB_URL=postgres://ballsdex:${POSTGRES_PASSWORD}@postgres:5432/ballsdex"
services:
bot:
restart: "no"
image: ballsdex
build: .
environment:
- *postgres-url
depends_on:
- postgres-db
# ports:
# - "15260:15260"
networks:
- internal
volumes:
- type: bind
source: ./
target: /code
tty: true
command: >
bash -c "
cd admin_panel &&
poetry run python3 manage.py migrate --no-input --fake-initial &&
cd .. && poetry run python3 -m ballsdex"
admin-panel:
image: ballsdex
build: .
ports:
- "8000:8000"
networks:
- internal
environment:
- *postgres-url
# if serving the admin panel online, copy the file "production.example.py" and uncomment
# - DJANGO_SETTINGS_MODULE=admin_panel.settings.production
depends_on:
- postgres-db
volumes:
- type: bind
source: ./
target: /code
tty: true
working_dir: /code/admin_panel
command: >
bash -c "
poetry run python3 manage.py migrate --no-input --fake-initial &&
poetry run python3 manage.py collectstatic --no-input &&
poetry run uvicorn admin_panel.asgi:application --host 0.0.0.0"
postgres-db:
image: postgres
restart: always
hostname: postgres
shm_size: 1g
environment:
- *postgres-db
- *postgres-user
- POSTGRES_PASSWORD
# WARNING: before exposing ports, change the default db password in the .env file!
# ports:
# - "5432:5432"
networks:
- internal
volumes: # Persist the db data
- database-data:/var/lib/postgresql/data
postgres-backup:
image: prodrigestivill/postgres-backup-local
restart: always
user: postgres:postgres
volumes:
- ./pgbackups:/backups
depends_on:
- postgres-db
networks:
- internal
environment:
- *postgres-db
- *postgres-user
- POSTGRES_PASSWORD
- POSTGRES_HOST=postgres
- SCHEDULE=@daily
- BACKUP_KEEP_DAYS=7
- BACKUP_KEEP_WEEKS=4
- BACKUP_KEEP_MONTHS=6
- HEALTHCHECK_PORT=3928
# Uncomment to enable gateway proxy feature and
# add "gateway-url: ws://gateway_proxy:5421" to your config.yaml
# Also change tag corresponding to your platform if not x86-64
#
# gateway-proxy:
# container_name: gateway_proxy
# image: ghcr.io/martinebot/gateway-proxy:x86-64
# restart: always
# volumes:
# - ./gatewayproxy/config.json:/config.json
# networks:
# - internal
volumes:
database-data:
cache-data:
networks:
internal: