-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
126 lines (119 loc) · 2.74 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
116
117
118
119
120
121
122
123
124
125
126
services:
nginx:
image: nginx:1.23-alpine
ports:
- 80:80
depends_on:
- web
volumes:
- static_volume:/home/app/web/staticfiles:ro
- ./backend/nginx/demo.conf:/etc/nginx/templates/default.conf.template
restart: always
web:
build:
context: .
dockerfile: backend/Dockerfile
target: demo
args:
VERSION: demo
image: spellbook-backend
expose:
- 8000
depends_on:
db:
condition: service_healthy
links:
- db
volumes:
- static_volume:/home/app/web/staticfiles:rw
env_file:
- backend/.env
- path: backend/secrets.env
required: false
environment:
SQL_ENGINE: django.db.backends.postgresql
SQL_DATABASE: spellbook_db_test
SQL_USER: test_user
SQL_PASSWORD: test_password
SQL_HOST: db
SQL_PORT: 5432
DATABASE: postgres
SECRET_KEY: demo-secret-key
healthcheck:
test: "wget --no-verbose --tries=1 --spider http://127.0.0.1:8000/ || exit 1"
start_period: 20s
interval: 10s
timeout: 10s
retries: 100
restart: always
db:
image: postgres:14-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
expose:
- 5432
environment:
PGPORT: 5432
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
POSTGRES_DB: spellbook_db_test
healthcheck:
test: ["CMD-SHELL", "pg_isready -q -d spellbook_db_test -U test_user" ]
interval: 5s
timeout: 5s
retries: 5
restart: always
discord-bot:
build:
context: .
dockerfile: bot/discord/Dockerfile
image: spellbook-discord-bot
depends_on:
web:
condition: service_healthy
links:
- web
env_file:
- bot/discord/.env
- path: bot/discord/secrets.env
required: false
environment:
SPELLBOOK_API_URL: http://web:8000
restart: always
# reddit-bot:
# build:
# context: .
# dockerfile: bot/reddit/Dockerfile
# image: spellbook-reddit-bot
# depends_on:
# web:
# condition: service_healthy
# links:
# - web
# env_file:
# - bot/reddit/.env
# - path: bot/reddit/secrets.env
# required: false
# environment:
# SPELLBOOK_API_URL: http://web:8000
# restart: always
telegram-bot:
build:
context: .
dockerfile: bot/telegram/Dockerfile
image: spellbook-telegram-bot
depends_on:
web:
condition: service_healthy
links:
- web
env_file:
- bot/telegram/.env
- path: bot/telegram/secrets.env
required: false
environment:
SPELLBOOK_API_URL: http://web:8000
restart: always
volumes:
static_volume:
postgres_data: