-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yml
98 lines (89 loc) · 2.7 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
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}
services:
traefik:
image: traefik:v2.0
command: --api.insecure --providers.docker
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "80:80"
- "443:443"
- "8080:8080"
php:
build:
context: ../api-platform-2.5.0/api
target: api_platform_php
<<: *api-cache-from
image: ${PHP_IMAGE:-quay.io/api-platform/php}
depends_on:
- db
volumes:
- ../api-platform-2.5.0/api:/srv/api:rw,cached
- ../api-platform-2.5.0/api/docker/php/conf.d/api-platform.dev.ini/:/usr/local/etc/php/conf.d/api-platform.ini
api:
build:
context: ../api-platform-2.5.0/api
target: api_platform_nginx
<<: *api-cache-from
image: ${NGINX_IMAGE:-quay.io/api-platform/nginx}
depends_on:
- php
volumes:
- ../api-platform-2.5.0/api/public:/srv/api/public:ro
labels:
- traefik.http.routers.api.rule=Host(`api.domain.com`)
db:
image: postgres:10-alpine
environment:
- POSTGRES_DB=api
- POSTGRES_PASSWORD=!ChangeMe!
- POSTGRES_USER=api-platform
volumes:
- db-data:/var/lib/postgresql/data:rw
labels:
- traefik.http.routers.db.rule=Host(`db.domain.com`)
mercure:
image: dunglas/mercure
environment:
- ALLOW_ANONYMOUS=1
- CORS_ALLOWED_ORIGINS=*
- DEMO=1
- JWT_KEY=!ChangeMe!
- PUBLISH_ALLOWED_ORIGINS=http://localhost:1337,https://localhost:1338
labels:
- traefik.http.routers.mercure.rule=Host(`mercure.domain.com`)
client:
build:
context: ../api-platform-2.5.0/client
target: api_platform_client_development
cache_from:
- ${CLIENT_IMAGE:-quay.io/api-platform/client}
image: ${CLIENT_IMAGE:-quay.io/api-platform/client}
environment:
- API_PLATFORM_CLIENT_GENERATOR_ENTRYPOINT=http://api
- API_PLATFORM_CLIENT_GENERATOR_OUTPUT=src
- REACT_APP_API_ENTRYPOINT=http://api.domain.com
volumes:
- ../api-platform-2.5.0/client:/usr/src/client:rw,cached
labels:
- traefik.http.routers.client.rule=Host(`domain.com`, `www.domain.com`)
admin:
build:
context: ../api-platform-2.5.0/admin
target: api_platform_admin_development
cache_from:
- ${ADMIN_IMAGE:-quay.io/api-platform/admin}
environment:
- REACT_APP_API_ENTRYPOINT=http://api.domain.com
image: ${ADMIN_IMAGE:-quay.io/api-platform/admin}
volumes:
- ../api-platform-2.5.0/admin:/usr/src/admin:rw,cached
labels:
- traefik.http.routers.admin.rule=Host(`admin.domain.com`)
volumes:
db-data: {}