-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yml
207 lines (195 loc) · 7.53 KB
/
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
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
name: roadiz-dev
services:
db:
build:
target: mysql
args:
UID: ${UID:-1000}
networks:
- default
volumes:
- "./.data/db:/var/lib/mysql"
environment:
MYSQL_RANDOM_ROOT_PASSWORD: 1
MYSQL_DATABASE: ${MYSQL_DATABASE:-db_name}
MYSQL_USER: ${MYSQL_USER:-db_user}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-db_password}
db-test:
build:
target: mysql
args:
UID: ${UID:-1000}
networks:
- default
volumes:
- "./.data/db_test:/var/lib/mysql"
environment:
MYSQL_RANDOM_ROOT_PASSWORD: 1
MYSQL_DATABASE: ${MYSQL_TEST_DATABASE:-db_name_test}
MYSQL_USER: ${MYSQL_USER:-db_user}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-db_password}
pma:
image: phpmyadmin:5.2.1
environment:
PMA_HOST: db
UPLOAD_LIMIT: 64M
PMA_USER: ${MYSQL_USER:-db_user}
PMA_PASSWORD: ${MYSQL_PASSWORD:-db_password}
depends_on:
- db
networks:
- frontproxynet
- default
labels:
- "traefik.enable=true"
- "traefik.http.services.${APP_NAMESPACE}_pma.loadbalancer.server.scheme=http"
- "traefik.http.services.${APP_NAMESPACE}_pma.loadbalancer.server.port=80"
- "traefik.http.services.${APP_NAMESPACE}_pma.loadbalancer.passhostheader=true"
# Listen HTTP
- "traefik.http.routers.${APP_NAMESPACE}_pma.entrypoints=http"
- "traefik.http.routers.${APP_NAMESPACE}_pma.rule=HostRegexp(${HOSTNAME_PMA})"
- "traefik.http.routers.${APP_NAMESPACE}_pma.service=${APP_NAMESPACE}_pma"
solr:
hostname: solr
build:
# Custom image for file permissions
target: solr
args:
UID: ${UID:-1000}
volumes:
- "solr_data:/var/solr"
command:
- solr-precreate
- ${SOLR_CORE_NAME}
networks:
- frontproxynet
- default
labels:
- "traefik.enable=true"
- "traefik.http.services.${APP_NAMESPACE}_solr.loadbalancer.server.scheme=http"
- "traefik.http.services.${APP_NAMESPACE}_solr.loadbalancer.server.port=8983"
- "traefik.http.services.${APP_NAMESPACE}_solr.loadbalancer.passhostheader=true"
# Listen HTTP
- "traefik.http.routers.${APP_NAMESPACE}_solr.entrypoints=http"
- "traefik.http.routers.${APP_NAMESPACE}_solr.rule=HostRegexp(${HOSTNAME_SOLR})"
- "traefik.http.routers.${APP_NAMESPACE}_solr.service=${APP_NAMESPACE}_solr"
redis:
image: redis:7-alpine
volumes:
- "redis:/data"
networks:
- default
app: &app_template
hostname: app
# Need to pass all vars to docker env for Crontab and supervisor scripts
env_file: "./.env.local"
build:
target: php-dev
args:
UID: ${UID:-1000}
depends_on:
- db
- solr
- redis
volumes:
- ./:/app
networks:
- default
environment:
PHP_CS_FIXER_IGNORE_ENV: 1
TRUSTED_PROXIES: ${TRUSTED_PROXIES}
UID: ${UID}
DEFAULT_GATEWAY: ${DEFAULT_GATEWAY}
worker:
<<: *app_template
hostname: app-worker
# Need to restart worker every 10 minutes
restart: unless-stopped
entrypoint: ["php", "/app/bin/console", "messenger:consume", "async", "--time-limit=600", "--profile"]
cron:
<<: *app_template
build:
target: cron-dev
args:
UID: ${UID:-1000}
hostname: app-cron
restart: unless-stopped
nginx:
build:
target: nginx-dev
args:
UID: ${UID:-1000}
depends_on:
- app
links:
- app:app
volumes:
# Need to share all app files for relative symlink to work in development
- ./:/app
networks:
- default
- frontproxynet
labels:
- "traefik.enable=true"
- "traefik.http.services.${APP_NAMESPACE}.loadbalancer.server.scheme=http"
- "traefik.http.services.${APP_NAMESPACE}.loadbalancer.server.port=80"
- "traefik.http.services.${APP_NAMESPACE}.loadbalancer.passhostheader=true"
# Listen HTTP
- "traefik.http.routers.${APP_NAMESPACE}.entrypoints=http"
- "traefik.http.routers.${APP_NAMESPACE}.rule=HostRegexp(${HOSTNAME}) && PathRegexp(${PATH_PREFIX})"
- "traefik.http.routers.${APP_NAMESPACE}.service=${APP_NAMESPACE}"
# Listen HTTPS
- "traefik.http.routers.${APP_NAMESPACE}_secure.entrypoints=https"
- "traefik.http.routers.${APP_NAMESPACE}_secure.rule=HostRegexp(${HOSTNAME}) && PathRegexp(${PATH_PREFIX})"
- "traefik.http.routers.${APP_NAMESPACE}_secure.tls=true"
- "traefik.http.routers.${APP_NAMESPACE}_secure.service=${APP_NAMESPACE}"
varnish:
build:
target: varnish
networks:
- default
- frontproxynet
depends_on:
- nginx
labels:
- "traefik.enable=true"
- "traefik.http.services.${APP_NAMESPACE}_varnish.loadbalancer.server.scheme=http"
- "traefik.http.services.${APP_NAMESPACE}_varnish.loadbalancer.server.port=80"
- "traefik.http.services.${APP_NAMESPACE}_varnish.loadbalancer.passhostheader=true"
# Listen HTTP
- "traefik.http.routers.${APP_NAMESPACE}_varnish.entrypoints=http"
- "traefik.http.routers.${APP_NAMESPACE}_varnish.rule=HostRegexp(${HOSTNAME_VARNISH}) && PathRegexp(${PATH_PREFIX})"
- "traefik.http.routers.${APP_NAMESPACE}_varnish.service=${APP_NAMESPACE}_varnish"
# Listen HTTPS
- "traefik.http.routers.${APP_NAMESPACE}_varnish_secure.entrypoints=https"
- "traefik.http.routers.${APP_NAMESPACE}_varnish_secure.rule=HostRegexp(${HOSTNAME_VARNISH}) && PathRegexp(${PATH_PREFIX})"
- "traefik.http.routers.${APP_NAMESPACE}_varnish_secure.tls=true"
- "traefik.http.routers.${APP_NAMESPACE}_varnish_secure.service=${APP_NAMESPACE}_varnish"
mailer:
hostname: mailer
image: axllent/mailpit
networks:
- frontproxynet
- default
labels:
- "traefik.enable=true"
- "traefik.http.services.${APP_NAMESPACE}_mailer.loadbalancer.server.scheme=http"
- "traefik.http.services.${APP_NAMESPACE}_mailer.loadbalancer.server.port=8025"
- "traefik.http.services.${APP_NAMESPACE}_mailer.loadbalancer.passhostheader=true"
# Listen HTTP
- "traefik.http.routers.${APP_NAMESPACE}_mailer.entrypoints=http"
- "traefik.http.routers.${APP_NAMESPACE}_mailer.rule=HostRegexp(${HOSTNAME_MAILER})"
- "traefik.http.routers.${APP_NAMESPACE}_mailer.service=${APP_NAMESPACE}_mailer"
networks:
frontproxynet:
external: true
# If you need to use port forwarding, fixing default gateway can be useful
# to keep same host IP address between service restarts
default:
ipam:
driver: default
config:
- subnet: ${DEFAULT_GATEWAY}/24
volumes:
redis:
solr_data: