-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
141 lines (130 loc) · 3.45 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
version: "3.4"
services:
certbot:
image: certbot/certbot
restart: unless-stopped
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
nginx:
build:
context: ./nginx
networks:
- host
ports:
- 80:80
- 443:443
volumes:
- './frontend/dist:/etc/nginx/html/'
- './docs/build/html:/var/www/docs.thesharegame.com'
- static_volume:/app/backend/staticfiles
- media_volume:/app/backend/mediafiles
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
restart: always
db:
image: postgres
networks:
- host
expose:
- "5432"
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_DB: "${POSTGRES_DB}"
backend:
build:
context: ./backend
networks:
- host
volumes:
- static_volume:/app/backend/staticfiles
- media_volume:/app/backend/mediafiles
- './.fonts:/usr/share/fonts/'
environment:
REDIS_URL: "${REDIS_URL}"
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_DB: "${POSTGRES_DB}"
POSTGRES_HOST: "${POSTGRES_HOST}"
POSTGRES_PORT: "${POSTGRES_PORT}"
SECRET_KEY: "${SECRET_KEY}"
DJANGO_SENTRY_DSN: "${DJANGO_SENTRY_DSN}"
DEBUG: "False"
RECAPTCHA_SECRET_KEY: "${RECAPTCHA_SECRET_KEY}"
depends_on:
- db
- redis
- nginx
redis:
image: "redis:alpine"
command: redis-server --appendonly yes
networks:
- host
expose:
- '6379'
celery_beat:
build:
context: ./backend
networks:
- host
environment:
REDIS_URL: "${REDIS_URL}"
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_DB: "${POSTGRES_DB}"
POSTGRES_HOST: "${POSTGRES_HOST}"
POSTGRES_PORT: "${POSTGRES_PORT}"
DJANGO_SENTRY_DSN: "${DJANGO_SENTRY_DSN}"
DEBUG: "False"
command: ["./wait-for-it.sh", "backend:8000", "--", "celery", "-A", "tsg", "beat", "-l", "debug"]
depends_on:
- redis
- backend
- celery_worker
- db
celery_worker:
build:
context: ./backend
networks:
- host
environment:
REDIS_URL: "${REDIS_URL}"
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_DB: "${POSTGRES_DB}"
POSTGRES_HOST: "${POSTGRES_HOST}"
POSTGRES_PORT: "${POSTGRES_PORT}"
DJANGO_SENTRY_DSN: "${DJANGO_SENTRY_DSN}"
DEBUG: "False"
command: ["./wait-for-it.sh", "backend:8000", "--", "celery", "-A", "tsg", "worker", "-l", "debug"]
depends_on:
- redis
- backend
- db
chat:
build:
context: ./backend/chat
networks:
- host
environment:
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_DB: "${POSTGRES_DB}"
POSTGRES_HOST: "${POSTGRES_HOST}"
POSTGRES_PORT: "${POSTGRES_PORT}"
REDIS_ADDR: "${REDIS_ADDR}"
GO_SENTRY_DSN: "${GO_SENTRY_DSN}"
command: ["./wait-for-it.sh", "backend:8000", "--", "./main"]
depends_on:
- db
- backend
volumes:
postgres_data:
static_volume:
media_volume:
networks:
host: