-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathcompose.yml
More file actions
143 lines (131 loc) · 2.9 KB
/
compose.yml
File metadata and controls
143 lines (131 loc) · 2.9 KB
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
x-app: &app
command: /var/www/bin/script/entry.sh
tty: true
stdin_open: true
user: "web:web"
build:
context: .
dockerfile: Dockerfile
target: ensl_${RAILS_ENV:-development}
volumes:
- .:/var/www
# Mount also files root somewhere, from $FILES_ROOT
environment:
RAILS_ENV: ${RAILS_ENV:-development}
depends_on:
- db
- redis
services:
#
# Main services
#
development:
<<: *app
profiles: ["development"]
environment:
- DISABLE_PUMA
- RAILS_DEBUG
ports:
- "${PUMA_PORT}:${PUMA_PORT}"
- "35729:35729"
sidekiq:
<<: *app
profiles: ["development", "staging", "production"]
command: bundle exec sidekiq
restart: unless-stopped
volumes:
- .:/var/www
- ${FILES_HOST_ROOT}:${FILES_ROOT}
staging:
<<: *app
profiles: ["staging"]
environment:
RAILS_ENV: staging
build:
context: .
dockerfile: Dockerfile
target: ensl_staging
ports:
- "9000:${PUMA_PORT}"
production:
<<: *app
profiles: ["production"]
environment:
RAILS_ENV: production
build:
context: .
dockerfile: Dockerfile
target: ensl_production
ports:
- "${PUMA_PORT}:${PUMA_PORT}"
depends_on:
- smtp
- redis
volumes:
- .:/var/www
- ${FILES_HOST_ROOT}:${FILES_ROOT}
networks:
default: {}
catpack_docker:
aliases:
- ensl_production
#
# Testing
#
test:
<<: *app
profiles: ["test"]
command: ["bash", "-c", "while true; do sleep 100; done;"]
build:
context: .
dockerfile: Dockerfile
target: ensl_development
env_file:
- .env.test
environment:
RAILS_ENV: test
ports:
- "${TEST_APP_PORT}:${TEST_APP_PORT}" # Capybara listens here
depends_on:
- db
# - selenium
# selenium:
# image: selenium/standalone-chrome-debug
# profiles: ["test"]
# ports:
# - "5900:5900"
# - "4444:4444"
# shm_size: 2gb
#
# Common services: These are shared by all envs.
#
redis:
image: redis:8.4.0
command: ["redis-server", "--loglevel", "warning"]
db:
image: mariadb:10.7
user: "mysql:mysql"
volumes:
- "./db/data:/var/lib/mysql"
- "./db/initdb.d:/docker-entrypoint-initdb.d"
- "./ext/mysql.conf.d:/etc/mysql/conf.d"
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_ROOT_HOST: ${MYSQL_ROOT_HOST}
smtp:
image: mwader/postfix-relay:latest
profiles: ["production"]
restart: always
volumes:
- "./ext/dkim:/etc/opendkim/keys"
environment:
POSTFIX_myhostname: ${MAIL_DOMAIN}
OPENDKIM_DOMAINS: ${MAIL_DOMAIN}
RSYSLOG_LOG_TO_FILE: yes
RSYSLOG_TIMESTAMP: yes
networks:
catpack_docker:
external: true