-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.prod.yml
192 lines (176 loc) · 5.54 KB
/
docker-compose.prod.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
version: '3.7'
services:
web:
build:
context: ./
dockerfile: Dockerfile.prod
networks:
- default
restart: always
command: gunicorn comohay.wsgi:application --bind 0.0.0.0:8000 --workers=3
volumes:
- ../static_volume:/home/app/web/static_root
- ../media_volume:/home/app/web/media
- solr_data:/home/app/web/solr_data
- telethon_sessions:/home/app/web/telethon_sessions
expose:
- 8000
env_file:
- ./.env.prod
logging:
options:
max-size: "100m"
max-file: "20"
depends_on:
- db
- solr
nginx:
build: ./nginx
networks:
- default
- frontproxynet
restart: always
volumes:
- ../static_volume:/home/app/web/static_root
- ../media_volume:/home/app/web/media
depends_on:
- web
logging:
options:
max-size: "100m"
max-file: "20"
labels:
- "traefik.enable=true"
- "traefik.http.routers.comohay.rule=Host(`comohay.com`)"
- "traefik.http.routers.comohay.entrypoints=http"
- "traefik.http.routers.comohay.service=comohay"
- "traefik.http.middlewares.comohay-redirectscheme.redirectscheme.scheme=https"
- "traefik.http.middlewares.comohay-redirectscheme.redirectscheme.permanent=false"
- "traefik.http.routers.comohay.middlewares=comohay-redirectscheme"
- "traefik.http.routers.comohay-secure.rule=Host(`comohay.com`)"
- "traefik.http.routers.comohay-secure.entrypoints=https"
- "traefik.http.routers.comohay-secure.service=comohay"
- "traefik.http.routers.comohay-secure.tls=true"
- "traefik.http.routers.comohay-secure.tls.certresolver=letsencrypt"
- "traefik.http.services.comohay.loadbalancer.server.port=80"
- "traefik.http.services.comohay.loadbalancer.server.scheme=http"
- "traefik.http.services.comohay.loadbalancer.passhostheader=true"
- "traefik.http.routers.divisascu.rule=Host(`api.divisascu.app`)"
- "traefik.http.routers.divisascu.entrypoints=http"
- "traefik.http.routers.divisascu.service=comohay"
- "traefik.http.middlewares.divisascu-redirectscheme.redirectscheme.scheme=https"
- "traefik.http.middlewares.divisascu-redirectscheme.redirectscheme.permanent=false"
- "traefik.http.routers.divisascu.middlewares=divisascu-redirectscheme"
- "traefik.http.routers.divisascu-secure.rule=Host(`api.divisascu.app`)"
- "traefik.http.routers.divisascu-secure.entrypoints=https"
- "traefik.http.routers.divisascu-secure.service=comohay"
- "traefik.http.routers.divisascu-secure.tls=true"
- "traefik.http.routers.divisascu-secure.tls.certresolver=letsencrypt"
- "traefik.http.middlewares.divisascu-redirect.redirectregex.regex=^https:\\/\\/([^\\/]+)\\/?$$"
- "traefik.http.middlewares.divisascu-redirect.redirectregex.replacement=https://$$1/api"
- "traefik.http.routers.divisascu-secure.middlewares=divisascu-redirect"
db:
image: postgres:12.0-alpine
networks:
- default
restart: always
volumes:
- ../postgres_data:/var/lib/postgresql/data/
env_file:
- ./.env.prod
logging:
options:
max-size: "100m"
max-file: "20"
redis:
restart: always
image: redis:6.2.6
expose:
- "6379"
logging:
options:
max-size: "50m"
max-file: "20"
celery_worker_1:
restart: always
build:
context: ./
dockerfile: Dockerfile.prod
command: celery --app comohay worker --loglevel=info -Q celery,ads_crawl,updater -n worker1@%h
volumes:
- ../static_volume:/home/app/web/static_root
- ../media_volume:/home/app/web/media
- solr_data:/home/app/web/solr_data
- telethon_sessions:/home/app/web/telethon_sessions
env_file:
- ./.env.prod
logging:
options:
max-size: "100m"
max-file: "20"
depends_on:
- web
- db
- redis
celery_worker_2:
restart: always
build:
context: ./
dockerfile: Dockerfile.prod
command: celery --app comohay worker --loglevel=info -Q telegram -n worker2@%h
volumes:
- ../static_volume:/home/app/web/static_root
- ../media_volume:/home/app/web/media
- solr_data:/home/app/web/solr_data
- telethon_sessions:/home/app/web/telethon_sessions
env_file:
- ./.env.prod
logging:
options:
max-size: "100m"
max-file: "20"
depends_on:
- web
- db
- redis
celery_beat:
restart: always
build:
context: ./
dockerfile: Dockerfile.prod
command: celery --app comohay beat --loglevel=info
volumes:
- ../static_volume:/home/app/web/static_root
- ../media_volume:/home/app/web/media
- solr_data:/home/app/web/solr_data
- telethon_sessions:/home/app/web/telethon_sessions
env_file:
- ./.env.prod
logging:
options:
max-size: "100m"
max-file: "20"
depends_on:
- web
- db
- redis
solr:
restart: always
image: solr:6.6
expose:
- "8983"
volumes:
- solr_data:/opt/solr/server/solr/mycores/
- ./solr_conf/ads_core_stopwords_es.txt:/home/ads_stopwords_es.txt
command: 'bash -e -c "precreate-core ads /opt/solr/server/solr/configsets/basic_configs; cp /home/ads_stopwords_es.txt /opt/solr/server/solr/mycores/ads/conf/lang/stopwords_es.txt; solr-foreground;"'
logging:
options:
max-size: "100m"
max-file: "20"
volumes:
postgres_data:
solr_data:
telethon_sessions:
networks:
frontproxynet:
external: true