-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
162 lines (162 loc) · 3.78 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
version: '2.3'
volumes:
bundle_cache: {}
db_data:
db_backup:
api_data:
redis_data:
services:
app:
build:
context: ./web
dockerfile: ./Dockerfile
depends_on:
- db
- api
- redis
- search
volumes:
- bundle_cache:/bundle
- ./scrapy/data:/var/www/scrapy/data
- ./web/public/uploads:/var/www/alegreme/public/uploads
- ./web/db/backups:/var/www/alegreme/db/backups
- ./logs/app:/var/www/alegreme/log
- ./storage:/var/www/alegreme/storage
environment:
RAILS_ENV: production
RACK_ENV: production
RAILS_SERVE_STATIC_FILES: 'false'
PGHOST: db
PGUSER: jon
API_URL: http://api
IS_DOCKER: 'true'
HTTP_HOST: 'alegreme.com'
NODE_ENV: production
WEB_CONCURRENCY: 2
RAILS_MAX_THREADS: 4
JOB_WORKER_URL: redis://redis:6379/0
REDIS_URL: redis://:password@redis:6379/1
ELASTICSEARCH_URL: http://search:9200
restart: always
ports:
- 3000:3000
command: bundle exec puma -C config/puma.rb
mem_limit: 5gb
memswap_limit: 6gb
mem_reservation: 256m
cpus: 3.5
sidekiq:
build:
context: ./web
dockerfile: ./docker/sidekiq/Dockerfile
depends_on:
- redis
- db
volumes:
- bundle_cache:/bundle
- ./web:/var/www/alegreme
- ./logs/sidekiq:/var/www/alegreme/log
working_dir: /var/www/alegreme
environment:
BUNDLE_USER_CONFIG : /var/www/alegreme/.bundle_config
RAILS_ENV: production
RACK_ENV: production
PGHOST: db
PGUSER: jon
API_URL: http://api
IS_DOCKER: 'true'
HTTP_HOST: 'alegreme.com'
NODE_ENV: production
WEB_CONCURRENCY: 2
RAILS_MAX_THREADS: 4
JOB_WORKER_URL: redis://redis:6379/0
command: bundle exec sidekiq -C /var/www/sidekiq/config.yml -r /var/www/alegreme
restart: always
mem_limit: 3gb
memswap_limit: 3gb
cpus: 2
db:
image: postgres:10
volumes:
- ./data/postgres:/var/lib/postgresql/data
environment:
POSTGRES_USER: jon
POSTGRES_PASSWORD: password
POSTGRES_DB: production
TZ: 'America/Sao_Paulo'
PGTZ: 'America/Sao_Paulo'
PRIVATE_IP: '10.136.227.110'
PUBLIC_IP: '159.89.84.18'
ports:
- 5432:5432
restart: always
mem_limit: 2gb
memswap_limit: 3gb
cpus: 2
web:
build:
context: ./web
dockerfile: ./docker/web/Dockerfile
depends_on:
- app
ports:
- 80:80
- 443:443
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
- ./logs/web:/var/www/alegreme/log
restart: always
mem_limit: 2gb
memswap_limit: 3gb
cpus: 2
certbot:
image: certbot/certbot
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
api:
build:
context: ./ml
dockerfile: ./Dockerfile
ports:
- "5000:5000"
volumes:
- api_data:/var/www/api/data
- ./ml/api:/var/www/ml/api
- ./scrapy/data:/var/www/scrapy/data
- ./logs/api:/var/www/ml/api/log
environment:
IS_DOCKER: 'true'
restart: always
mem_limit: 4gb
memswap_limit: 4gb
mem_reservation: 256m
cpus: 3
redis:
image: redis
environment:
REDIS_PASSWORD: password
command: redis-server --appendonly yes --requirepass password
volumes:
- redis_data:/data
ports:
- 6379:6379
mem_limit: 3gb
memswap_limit: 3gb
mem_reservation: 256m
cpus: 2
restart: always
search:
build:
context: ./search
dockerfile: ./Dockerfile
environment:
discovery.type: single-node
ports:
- "9200:9200"
mem_limit: 2gb
memswap_limit: 2gb
mem_reservation: 256m
cpus: 1.5
restart: always