-
Notifications
You must be signed in to change notification settings - Fork 14
/
docker-compose.yml
94 lines (87 loc) · 2.49 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
version: "3.4"
services:
php:
image: quay.io/api-platform/php
build:
context: ./backend
target: api_platform_php
cache_from:
- quay.io/api-platform/php
- quay.io/api-platform/nginx
- quay.io/api-platform/varnish
depends_on:
- db
- db-test
# Comment out these volumes in production
volumes:
- ./backend:/srv/api:rw,cached
# If you develop on Linux, uncomment the following line to use a bind-mounted host directory instead
# - ./backend/var:/srv/api/var:rw
environment:
# Specify here the IDE_KEY used in your browser
PHP_IDE_CONFIG: serverName=PHPSTORM
api:
image: quay.io/api-platform/nginx
build:
context: ./backend
target: api_platform_nginx
cache_from:
- quay.io/api-platform/php
- quay.io/api-platform/nginx
- quay.io/api-platform/varnish
depends_on:
- php
# Comment out this volume in production
volumes:
- ./backend/public:/srv/api/public:ro
ports:
- "8000:80"
cache-proxy:
image: quay.io/api-platform/varnish
build:
context: ./backend
target: api_platform_varnish
cache_from:
- quay.io/api-platform/php
- quay.io/api-platform/nginx
- quay.io/api-platform/varnish
depends_on:
- api
volumes:
- ./backend/docker/varnish/conf:/usr/local/etc/varnish:ro
tmpfs:
- /usr/local/var/varnish:exec
ports:
- "8081:80"
db:
# In production, you may want to use a managed database service
image: postgres:10.6-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
ports:
- "5432:5432"
db-test:
image: postgres:10.6-alpine
environment: # Credentials must differ from the main database in order to avoid what we call in France "Programmation par coïncidence"
- POSTGRES_DB=seed
- POSTGRES_USER=seed
- POSTGRES_PASSWORD=Ge0rgesMoustaki
h2-proxy:
# Don't use this proxy in prod
build:
context: ./h2-proxy
depends_on:
- api
- cache-proxy
ports:
- "8443:8443"
- "8444:8444"
volumes:
db-data: {}