-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
127 lines (116 loc) · 3.22 KB
/
docker-compose.yml
File metadata and controls
127 lines (116 loc) · 3.22 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
version: '3.4'
x-cache:
&cache
cache_from:
- ${CONTAINER_REGISTRY_BASE}/php
- ${CONTAINER_REGISTRY_BASE}/nginx
- ${CONTAINER_REGISTRY_BASE}/varnish
- ${CONTAINER_REGISTRY_BASE}/app
- ${CONTAINER_REGISTRY_BASE}/admin
- ${CONTAINER_REGISTRY_BASE}/rabbitmq
- ${CONTAINER_REGISTRY_BASE}/php-consume
services:
php:
container_name: ${KUBE_APP_NAME}-php
image: ${CONTAINER_REGISTRY_BASE}/php
build:
context: ./api
target: api_platform_php
<<: *cache
depends_on:
- db
- rabbitmq
volumes:
- php-pid:/tmp/PID:rw,cached
# If you develop on Linux, uncomment the following line to use a bind-mounted host directory instead
# - ./api/var:/srv/api/var:rw
api:
container_name: ${KUBE_APP_NAME}-api
image: ${CONTAINER_REGISTRY_BASE}/nginx
build:
context: ./api
target: api_platform_nginx
<<: *cache
depends_on:
- php
environment:
KUBE_APP_NAME: ${KUBE_APP_NAME}
cache-proxy:
image: ${CONTAINER_REGISTRY_BASE}/varnish
build:
context: ./api
target: api_platform_varnish
<<: *cache
depends_on:
- api
environment:
KUBE_APP_NAME: ${KUBE_APP_NAME}
db:
# In production, you may want to use a managed database service
image: postgres:10-alpine
environment:
- POSTGRES_DB=api
- POSTGRES_USER=api-platform
# You should definitely change the password in production
- POSTGRES_PASSWORD=!ChangeMe!
volumes:
- db-data:/var/lib/postgresql/data:rw
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/db/data:/var/lib/postgresql/data:rw
mercure:
# In production, you may want to use the managed version of Mercure, https://mercure.rocks
image: dunglas/mercure
environment:
# You should definitely change all these values in production
- JWT_KEY=!UnsecureChangeMe!
- ALLOW_ANONYMOUS=1
- CORS_ALLOWED_ORIGINS=*
- PUBLISH_ALLOWED_ORIGINS=http://localhost:1337,https://localhost:1338
- DEMO=1
app:
image: ${CONTAINER_REGISTRY_BASE}/app
build:
context: ./app
<<: *cache
env_file:
- ./app/.env
volumes:
- ./app:/usr/src/app:rw,cached
- /usr/src/client/node_modules
admin:
# Use a static website hosting service in production
# See https://facebook.github.io/create-react-app/docs/deployment
image: ${CONTAINER_REGISTRY_BASE}/admin
build:
context: ./admin
<<: *cache
volumes:
- ./admin:/usr/src/admin:rw,cached
- /usr/src/admin/node_modules
rabbitmq:
image: ${CONTAINER_REGISTRY_BASE}/rabbitmq
build:
context: ./rabbitmq
<<: *cache
volumes:
- rabbitmq:/var/lib/rabbitmq:cached
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
php-consume:
image: ${CONTAINER_REGISTRY_BASE}/php-consume
build:
context: ./api
target: api_platform_php_consume
<<: *cache
restart: on-failure
depends_on:
- db
- php
- rabbitmq
volumes:
- php-pid:/tmp/PID:ro,cached
volumes:
db-data: {}
rabbitmq: {}
php-pid: {}