This repository has been archived by the owner on May 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yml
186 lines (174 loc) · 5.04 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
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
version: '3.4'
x-cache-from:
- &api-cache-from
cache_from:
- ${NGINX_IMAGE:-quay.io/lctrs/nginx}
- ${PHP_IMAGE:-quay.io/lctrs/php}
- ${PROJECTION_IMAGE:-quay.io/lctrs/projection}
services:
php:
build:
context: ./api
target: api_platform_php
<<: *api-cache-from
image: ${PHP_IMAGE:-quay.io/lctrs/php}
healthcheck:
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
depends_on:
- db
- dev-tls
- event-store
environment:
- EVENT_STORE_URL=http://event-store:2113
volumes:
- ./api:/srv/api:z,cached
- ./api/docker/php/conf.d/api-platform.dev.ini:/usr/local/etc/php/conf.d/api-platform.ini
# If you don't develop on Linux, comment the following line to not use a bind-mounted host directory instead
- ./api/var:/srv/api/var:z
- dev-certs:/certs:ro,nocopy
api:
build:
context: ./api
target: api_platform_nginx
<<: *api-cache-from
image: ${NGINX_IMAGE:-quay.io/lctrs/nginx}
depends_on:
- php
volumes:
- ./api/public:/srv/api/public:ro
vulcain:
image: dunglas/vulcain
environment:
- CERT_FILE=/certs/localhost.crt
- KEY_FILE=/certs/localhost.key
- UPSTREAM=http://api
depends_on:
- api
- dev-tls
volumes:
- dev-certs:/certs:ro,nocopy
ports:
- target: 443
published: 8443
protocol: tcp
db:
image: postgres:12-alpine
environment:
- POSTGRES_DB=api
- POSTGRES_PASSWORD=!ChangeMe!
- POSTGRES_USER=api-platform
volumes:
- db-data:/var/lib/postgresql/data:z
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./api/docker/db/data:/var/lib/postgresql/data:z
ports:
- target: 5432
published: 5432
protocol: tcp
event-store:
image: eventstore/eventstore:release-5.0.7
ports:
- target: 1113
published: 1113
protocol: tcp
- target: 2113
published: 2113
protocol: tcp
client:
build:
context: ./client
target: api_platform_client_development
cache_from:
- ${CLIENT_IMAGE:-quay.io/lctrs/client}
image: ${CLIENT_IMAGE:-quay.io/lctrs/client}
tty: true # https://github.com/facebook/create-react-app/issues/8688
environment:
- API_PLATFORM_CLIENT_GENERATOR_ENTRYPOINT=http://api
- API_PLATFORM_CLIENT_GENERATOR_OUTPUT=src
depends_on:
- dev-tls
volumes:
- ./client:/usr/src/client:z,cached
- dev-certs:/usr/src/client/node_modules/webpack-dev-server/ssl:ro,nocopy
ports:
- target: 3000
published: 443
protocol: tcp
admin:
build:
context: ./admin
target: api_platform_admin_development
cache_from:
- ${ADMIN_IMAGE:-quay.io/lctrs/admin}
image: ${ADMIN_IMAGE:-quay.io/lctrs/admin}
tty: true # https://github.com/facebook/create-react-app/issues/8688
depends_on:
- dev-tls
volumes:
- ./admin:/usr/src/admin:z,cached
- dev-certs:/usr/src/admin/node_modules/webpack-dev-server/ssl:ro,nocopy
ports:
- target: 3000
published: 444
protocol: tcp
dev-tls:
build:
context: ./docker/dev-tls
volumes:
- dev-certs:/certs:z
ports:
- target: 80
published: 80
protocol: tcp
projection_book:
build:
context: ./api
target: api_platform_projection
<<: *api-cache-from
image: ${PROJECTION_IMAGE:-quay.io/lctrs/projection}
depends_on:
- db
- dev-tls
- event-store
environment:
- EVENT_STORE_URL=http://event-store:2113
- EVENT_STORE_CREDENTIALS=admin:changeit
- STREAM=$$ce-book
- GROUP_NAME=doctrine-read-model
volumes:
- ./api:/srv/api:z,cached
- ./api/docker/php/conf.d/api-platform.dev.ini/:/usr/local/etc/php/conf.d/api-platform.ini
# If you don't develop on Linux, comment the following line to not use a bind-mounted host directory instead
- ./api/var:/srv/api/var:z
- dev-certs:/certs:ro,nocopy
entrypoint: docker-entrypoint
command: bin/console app:run-projections -vvv
projection_review:
build:
context: ./api
target: api_platform_projection
<<: *api-cache-from
image: ${PROJECTION_IMAGE:-quay.io/lctrs/projection}
depends_on:
- db
- dev-tls
- event-store
environment:
- EVENT_STORE_URL=http://event-store:2113
- EVENT_STORE_CREDENTIALS=admin:changeit
- STREAM=$$ce-review
- GROUP_NAME=doctrine-read-model
volumes:
- ./api:/srv/api:z,cached
- ./api/docker/php/conf.d/api-platform.dev.ini/:/usr/local/etc/php/conf.d/api-platform.ini
# If you don't develop on Linux, comment the following line to not use a bind-mounted host directory instead
- ./api/var:/srv/api/var:z
- dev-certs:/certs:ro,nocopy
entrypoint: docker-entrypoint
command: bin/console app:run-projections -vvv
volumes:
db-data: {}
dev-certs: {}