-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
187 lines (174 loc) · 4.63 KB
/
docker-compose.yml
File metadata and controls
187 lines (174 loc) · 4.63 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
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
## This has been modified from the API Platform template implementation
## More specifically from https://github.com/dunglas/demo-vulcain-api-platform
version: '3.8'
x-cache-from:
- &api-cache-from
cache_from:
- ${NGINX_IMAGE:-registry.gitlab.com/silverback-web-apps/cwa/nginx}
- ${PHP_IMAGE:-registry.gitlab.com/silverback-web-apps/cwa/php}
- ${VARNISH_IMAGE:-registry.gitlab.com/silverback-web-apps/cwa/varnish}
- &app-cache-from
cache_from:
- ${APP_IMAGE:-registry.gitlab.com/silverback-web-apps/cwa/app}
services:
php:
build:
context: ./api
target: cwa_php
<<: *api-cache-from
image: ${PHP_IMAGE:-registry.gitlab.com/silverback-web-apps/cwa/php}
healthcheck:
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
depends_on:
- db
- dev-tls
environment:
BLACKFIRE_CLIENT_ID: ~
BLACKFIRE_CLIENT_TOKEN: ~
# TODO: Remove environment variable once recipe is added to recipes-contrib repository
SYMFONY_ENDPOINT: ~
volumes:
- ./api:/srv/api:rw,cached
- ./api/_docker/php/conf.d/cwa.dev.ini:/usr/local/etc/php/cwa.dev.ini
# if you develop on Linux, you may use a bind-mounted host directory instead
# - ./api/var:/srv/api/var:rw
- dev-certs:/certs:ro,nocopy
api:
build:
context: ./api
target: cwa_nginx
<<: *api-cache-from
image: ${NGINX_IMAGE:-registry.gitlab.com/silverback-web-apps/cwa/nginx}
depends_on:
- php
volumes:
- ./api/public:/srv/api/public:ro
ports:
- target: 80
published: 8080
protocol: tcp
cache-proxy:
build:
context: ./api
target: cwa_varnish
<<: *api-cache-from
image: ${VARNISH_IMAGE:-registry.gitlab.com/silverback-web-apps/cwa/varnish}
restart: always
environment:
UPSTREAM: api
UPSTREAM_PORT: 80
PHP_SERVICE: php
depends_on:
- api
tmpfs:
- /usr/local/var/varnish:exec
volumes:
- ./api/_docker/varnish/conf/default.vcl:/tmp/varnish/conf/default.vcl:rw
vulcain:
image: dunglas/vulcain
environment:
- CERT_FILE=/certs/localhost.crt
- KEY_FILE=/certs/localhost.key
- UPSTREAM=http://cache-proxy:8080
depends_on:
- cache-proxy
- dev-tls
volumes:
- dev-certs:/certs:ro
ports:
- target: 443
published: 8443
protocol: tcp
db:
image: postgres:12.2-alpine
environment:
- POSTGRES_MULTIPLE_DATABASES=api,api_test
- POSTGRES_USER=api-platform
- POSTGRES_PASSWORD=!ChangeMe!
volumes:
- ./api/_docker/postgres-init-scripts:/docker-entrypoint-initdb.d
- db-data:/var/lib/postgresql/data:rw,delegated
ports:
- target: 5432
published: 5432
protocol: tcp
mercure:
image: dunglas/mercure
environment:
- ALLOW_ANONYMOUS=1
- CERT_FILE=/certs/localhost.crt
- CORS_ALLOWED_ORIGINS=*
- DEMO=1
- JWT_KEY=!ChangeMe!
- KEY_FILE=/certs/localhost.key
- PUBLISH_ALLOWED_ORIGINS=https://localhost:1337 # required for publishing from the demo page
depends_on:
- dev-tls
volumes:
- dev-certs:/certs:ro
ports:
- target: 443
published: 1337
protocol: tcp
dev-tls:
build:
context: ./docker/dev-tls
volumes:
- dev-certs:/certs:rw
ports:
- target: 80
published: 80
protocol: tcp
blackfire:
image: blackfire/blackfire
ports: ["8707"]
environment:
# Exposes BLACKFIRE_* environment variables from the host
BLACKFIRE_SERVER_ID: ~
BLACKFIRE_SERVER_TOKEN: ~
# BLACKFIRE_LOG_LEVEL: 4
app:
build:
context: ./app
target: cwa_app
<<: *app-cache-from
image: ${APP_IMAGE:-registry.gitlab.com/silverback-web-apps/cwa/app}
depends_on:
- dev-tls
volumes:
- ./app:/usr/src/app:rw,cached
- dev-certs:/certs:ro
env_file:
- ./app/.env
environment:
NODE_TLS_REJECT_UNAUTHORIZED: 0
ports:
- target: 3000
published: 443
protocol: tcp
admin:
build:
context: ./admin
target: api_platform_admin_development
cache_from:
- ${ADMIN_IMAGE:-quay.io/api-platform/admin}
image: ${ADMIN_IMAGE:-quay.io/api-platform/admin}
depends_on:
- dev-tls
volumes:
- ./admin:/usr/src/admin:rw,cached
- dev-certs:/usr/src/admin/node_modules/webpack-dev-server/ssl:ro
ports:
- target: 3000
published: 444
protocol: tcp
env_file:
- ./admin/.env.local
smtp_relay:
image: namshi/smtp
volumes:
db-data: {}
dev-certs: {}