-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yml
executable file
·91 lines (84 loc) · 2.32 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
# Production docker-compose file.
# Run with: docker-compose up
version: '3.7'
services:
db:
# This will give a warning on initial boot:
# root@localhost is created with an empty password !
# It refers just to the first boot, the root user with password is created later
# while the database is listening only on the unix socket.
# https://github.com/docker-library/mysql/issues/307
image: 'mysql:8.0.22'
volumes:
- 'db:/var/lib/mysql'
env_file:
- '.env'
environment:
- MYSQL_DATABASE=esr_api_production
restart: always
docs:
image: awesometic/docusaurus
ports:
- '3002:80'
volumes:
- './docs:/docusaurus'
environment:
- WEBSITE_NAME=docs
redis:
image: 'redis:6.0.9-alpine'
command: redis-server --requirepass ${REDIS_PASSWORD}
depends_on:
- redis_helper
sysctls:
# This removes 'WARNING: /proc/sys/net/core/somaxconn is set to the lower value of 128'
# Explanation of what this setting does: https://groups.google.com/d/msg/redis-db/ftmlTjEPv98/HwkJguxTCwAJ
net.core.somaxconn: '511'
volumes:
- 'redis:/data'
env_file:
- '.env'
restart: always
# Fix Redis 'WARNING you have Transparent Huge Pages (THP) support'.
# From: https://stackoverflow.com/a/58090841
# More details: https://easyengine.io/tutorials/redis/
redis_helper:
image: busybox:1.32.0
command: sh -c "echo never > /sys/kernel/mm/transparent_hugepage/enabled"
privileged: true
rails:
depends_on:
- db
- redis
- sidekiq
build: .
command: ./script/start_rails_production.sh
ports:
- '3001:3000'
volumes:
- '.:/app'
environment:
- NODE_ENV=production
- RAILS_ENV=production
- RAILS_MAX_THREADS=5 # See config/puma.rb for more info.
- WEB_CONCURRENCY=2 # See config/puma.rb for more info.
- RAILS_SERVE_STATIC_FILES=true
env_file:
- '.env'
restart: always
sidekiq:
depends_on:
- 'db'
- 'redis'
build: .
command: ./script/start_sidekiq.sh
volumes:
- '.:/app'
environment:
- NODE_ENV=production
- RAILS_ENV=production
env_file:
- '.env'
restart: 'no' # Don't restart; any errors on imports should be investigated rather than repeated.
volumes:
redis:
db: