-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
161 lines (150 loc) · 4.51 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
# All Traefik labels are documented at https://doc.traefik.io/traefik/v2.0/routing/providers/docker/
# Further documentation at https://doc.traefik.io/traefik/v2.0/providers/docker/
version: "3"
services:
traefik:
image: "library/traefik:v2.9"
command:
- --entrypoints.web.address=:80
- --entrypoints.traefik.address=:8600
- --entrypoints.web-secure.address=:443
- --providers.file.directory=/etc/traefik/config
- --providers.docker
- --providers.docker.exposedByDefault=false
- --api.insecure
- --accesslog=true
ports:
- "${WEB_PORT}:80"
- "${WEBSECURE_PORT}:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./traefik/config:/etc/traefik/config"
- "./certificates:/etc/certificates"
networks:
- web-external
- web-internal
- data-internal
labels:
- traefik.enable=true
- traefik.http.routers.api.service=api@internal
- traefik.http.routers.api.entrypoints=web-secure
- traefik.http.routers.api.rule=Host(`${HOSTNAME}`) && PathPrefix(`/traefik/`) || (PathPrefix(`/api/`) && HeadersRegexp(`Referer`, `https://${HOSTNAME}/traefik/dashboard/*`))
- traefik.http.routers.api.tls=true
- traefik.http.routers.api.middlewares=traefik-prefix-stripper
- traefik.http.middlewares.traefik-prefix-stripper.stripprefix.prefixes=/traefik/
nginx:
build:
dockerfile: dockerfiles/Dockerfile-nginx
context: .
networks:
- web-external
- web-internal
- data-internal
volumes:
- ./:/data
labels:
- traefik.enable=true
- traefik.http.routers.nginx.rule=Host(`${HOSTNAME}`)
- traefik.http.routers.nginx-secure.rule=Host(`${HOSTNAME}`)
- traefik.http.routers.nginx-secure.tls=true
- traefik.http.services.nginx.loadbalancer.server.port=8080
php-fpm: &php-fpm
image: php-fpm
network_mode: service:nginx
build:
dockerfile: dockerfiles/Dockerfile-php-fpm
context: .
args:
PHP_VERSION: ${PHP_VERSION}
volumes:
- ./:/data
environment:
PHP_IDE_CONFIG: "serverName=${HOSTNAME}"
php-cli: &php-cli
networks:
- data-internal
- web-internal
# - web-external
build:
dockerfile: dockerfiles/Dockerfile-php-cli
context: .
args:
PHP_VERSION: ${PHP_VERSION}
command: /bin/bash -c "sleep infinity"
volumes:
- ./:/data
environment:
BASE_URI: "${BASE_URI}"
BLACKFIRE_CLIENT_ID: "${BLACKFIRE_CLIENT_ID}"
BLACKFIRE_CLIENT_TOKEN: "${BLACKFIRE_CLIENT_TOKEN}"
php-cli-xdebug:
<<: *php-cli
build:
dockerfile: dockerfiles/Dockerfile-php-cli-xdebug
context: .
args:
PHP_VERSION: ${PHP_VERSION}
command: /bin/bash -c "sleep infinity"
environment:
BASE_URI: "${BASE_URI}"
PHP_IDE_CONFIG: "serverName=${HOSTNAME}"
XDEBUG_SESSION: PHPSTORM
db:
image: mariadb
networks:
- data-internal
ports:
- "${DATABASE_PORT}:3306"
environment:
MYSQL_ROOT_PASSWORD: "local"
MYSQL_DATABASE: "local"
MYSQL_USER: "local"
MYSQL_PASSWORD: "local"
volumes:
- ./sql/init:/docker-entrypoint-initdb.d
redis:
image: redis:5.0
networks:
- data-internal
blackfire:
image: blackfire/blackfire:2
networks:
- data-internal
volumes:
- ./:/data
environment:
BLACKFIRE_SERVER_ID: "${BLACKFIRE_SERVER_ID}"
BLACKFIRE_SERVER_TOKEN: "${BLACKFIRE_SERVER_TOKEN}"
BLACKFIRE_CLIENT_ID: "${BLACKFIRE_CLIENT_ID}"
BLACKFIRE_CLIENT_TOKEN: "${BLACKFIRE_CLIENT_TOKEN}"
selenium:
image: seleniarm/standalone-chromium:latest
ports:
- "${CHROME_PORT:-4444}:4444"
shm_size: 2g
networks:
- web-external
- web-internal
- data-internal
volumes:
- /dev/shm:/dev/shm
mailhog:
image: mailhog/mailhog
networks:
- web-external
labels:
- traefik.enable=true
- traefik.http.routers.mailhog.entrypoints=web-secure
- traefik.http.routers.mailhog.rule=Host(`${HOSTNAME}`) && PathPrefix(`/mailhog/`)
- traefik.http.routers.mailhog.tls=true
- traefik.http.routers.mailhog.middlewares=mailhog-prefix-stripper
- traefik.http.middlewares.mailhog-prefix-stripper.stripprefix.prefixes=/mailhog/
- traefik.http.services.mailhog.loadbalancer.server.port=8025
networks:
web-external:
driver: bridge
# Used for PHPunit web tests:
web-internal:
driver: bridge
data-internal:
driver: bridge