-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yml
executable file
·114 lines (102 loc) · 3.16 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
version: '3.4'
x-cache-from:
- &api-cache-from
cache_from:
- ${NGINX_IMAGE:-quay.io/api-platform/nginx}
- ${PHP_IMAGE:-quay.io/api-platform/php}
x-react-env:
- &react-env
environment:
- REACT_APP_API_ENTRYPOINT=${HTTP_OR_SSL}api.${DOMAIN_NAME}
x-networks: &networks
networks:
- api_platform_multiple_1
services:
php:
build:
context: ${FOLDER_LOCATION}/api
target: api_platform_php
<<: *api-cache-from
image: ${PHP_IMAGE:-quay.io/api-platform/php}
depends_on:
- db
environment:
- APP_ENV=${APP_ENV}
- TRUSTED_HOSTS=^((${SUBDOMAINS_LIST}\.)?${DOMAIN_NAME})$$
- CORS_ALLOW_ORIGIN=^(${HTTP_OR_SSL}(${SUBDOMAINS_LIST}.)?${DOMAIN_NAME})$$
- DATABASE_URL=postgres://${DATABASE_USER}:${DATABASE_PASS}@db/${DATABASE_NAME}
volumes:
- ${FOLDER_LOCATION}/api:/srv/api:rw,cached
- ${FOLDER_LOCATION}/api/docker/php/conf.d/api-platform.dev.ini/:/usr/local/etc/php/conf.d/api-platform.ini
<<: *networks
api:
build:
context: ${FOLDER_LOCATION}/api
target: api_platform_nginx
<<: *api-cache-from
image: ${NGINX_IMAGE:-quay.io/api-platform/nginx}
depends_on:
- php
volumes:
- ${FOLDER_LOCATION}/api/public:/srv/api/public:ro
labels:
- traefik.http.routers.api-${APP_FOLDER}.rule=Host(`api.${DOMAIN_NAME}`)
<<: *networks
db:
image: postgres:10-alpine
environment:
- POSTGRES_DB=${DATABASE_NAME}
- POSTGRES_PASSWORD=${DATABASE_PASS}
- POSTGRES_USER=${DATABASE_USER}
volumes:
- db-data:/var/lib/postgresql/data:rw
labels:
- traefik.http.routers.db-${APP_FOLDER}.rule=Host(`db.${DOMAIN_NAME}`)
<<: *networks
mercure:
image: dunglas/mercure
environment:
- ALLOW_ANONYMOUS=1
- CORS_ALLOWED_ORIGINS=${HTTP_OR_SSL}(${SUBDOMAINS_LIST}\.)?${DOMAIN_NAME}
- DEMO=1
- JWT_KEY=!ChangeMe!
- PUBLISH_ALLOWED_ORIGINS=${HTTP_OR_SSL}mercure.${DOMAIN_NAME}
labels:
- traefik.http.routers.mercure-${APP_FOLDER}.rule=Host(`mercure.${DOMAIN_NAME}`)
<<: *networks
client:
build:
context: ${FOLDER_LOCATION}/client
target: api_platform_client_development
cache_from:
- ${CLIENT_IMAGE:-quay.io/api-platform/client}
image: ${CLIENT_IMAGE:-quay.io/api-platform/client}
<<: *react-env
volumes:
- ${FOLDER_LOCATION}/client:/usr/src/client:rw,cached
labels:
- traefik.http.routers.client-${APP_FOLDER}.rule=HostRegexp(`{subdomains:(www.)?}${DOMAIN_NAME}`)
<<: *networks
admin:
build:
context: ${FOLDER_LOCATION}/admin
target: api_platform_admin_development
cache_from:
- ${ADMIN_IMAGE:-quay.io/api-platform/admin}
<<: *react-env
image: ${ADMIN_IMAGE:-quay.io/api-platform/admin}
volumes:
- ${FOLDER_LOCATION}/admin:/usr/src/admin:rw,cached
labels:
- traefik.http.routers.admin-${APP_FOLDER}.rule=Host(`admin.${DOMAIN_NAME}`)
<<: *networks
whoami:
image: containous/whoami
labels:
- traefik.http.routers.whoami.rule=Host(`whoami.${DOMAIN_NAME}`)
<<: *networks
volumes:
db-data: {}
networks:
api_platform_multiple_1:
external: true