-
Notifications
You must be signed in to change notification settings - Fork 76
/
docker-compose.yml
136 lines (124 loc) · 4.96 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
version: '2.3'
x-lagoon-project:
# Lagoon project name (leave `&lagoon-project` when you edit this)
&lagoon-project drupal-decoupled-app
x-drupal-volumes:
&drupal-volumes
# Define all volumes you would like to have real-time mounted into the drupal docker containers
volumes:
- ./backend:/app:delegated
x-environment:
&default-environment
LAGOON_PROJECT: *lagoon-project
# Route that should be used locally
LAGOON_ROUTE: http://drupal-decoupled-app.docker.amazee.io
# Uncomment if you like to have the system behave like in production
#LAGOON_ENVIRONMENT_TYPE: production
# Uncomment to enable xdebug and then restart via `docker-compose up -d`
#XDEBUG_ENABLE: "true"
services:
frontend:
command: yarn run dev # this only applies for local development
build: # how to build the frontend
context: frontend
dockerfile: Dockerfile
labels:
# Lagoon Labels
lagoon.type: node
volumes:
- ./frontend/app:/app/app:delegated # specifically only mount the /frontend/app folder, so that node_module are still existing from the Docker Build
environment:
<< : *default-environment # loads the defined environment variables from the top
LAGOON_LOCALDEV_URL: drupal-decoupled-app.docker.amazee.io
API: http://drupal-varnish.drupal-decoupled-app.docker.amazee.io/graphql
extra_hosts:
- "drupal-varnish.drupal-decoupled-app.docker.amazee.io:172.17.0.1" # Telling the frontend how to communicate with the drupal
networks:
- amazeeio-network
- default
cli: # cli container, will be used for executing composer and any local commands (drush, drupal, etc.)
build:
context: backend
dockerfile: Dockerfile.cli
image: *lagoon-project # this image will be reused as `CLI_IMAGE` in subsequent Docker builds
labels:
# Lagoon Labels
lagoon.type: cli-persistent
lagoon.persistent.name: nginx # mount the persistent storage of nginx into this container
lagoon.persistent: /app/web/sites/default/files/ # location where the persistent storage should be mounted
<< : *drupal-volumes # loads the defined volumes from the top
volumes_from: # mount the ssh-agent from the pygmy or cachalot ssh-agent
- container:amazeeio-ssh-agent
environment:
<< : *default-environment # loads the defined environment variables from the top
nginx:
build:
context: backend
dockerfile: Dockerfile.nginx
args:
CLI_IMAGE: *lagoon-project # Inject the name of the cli image
labels:
lagoon.type: nginx-php-persistent
lagoon.persistent: /app/web/sites/default/files/ # define where the persistent storage should be mounted too
<< : *drupal-volumes # loads the defined volumes from the top
depends_on:
- cli # basically just tells docker-compose to build the cli first
environment:
<< : *default-environment # loads the defined environment variables from the top
LAGOON_LOCALDEV_URL: nginx.drupal-decoupled-app.docker.amazee.io # generate another route for nginx
networks:
- amazeeio-network
- default
php:
build:
context: backend
dockerfile: Dockerfile.php
args:
CLI_IMAGE: *lagoon-project
labels:
lagoon.type: nginx-php-persistent
lagoon.name: nginx # we want this service be part of the nginx pod in Lagoon
lagoon.persistent: /app/web/sites/default/files/ # define where the persistent storage should be mounted too
<< : *drupal-volumes # loads the defined volumes from the top
depends_on:
- cli # basically just tells docker-compose to build the cli first
environment:
<< : *default-environment # loads the defined environment variables from the top
mariadb:
image: amazeeio/mariadb-drupal
labels:
lagoon.type: mariadb
ports:
- "3306" # exposes the port 3306 with a random local port, find it with `docker-compose port mariadb 3306`
environment:
<< : *default-environment
# redis:
# image: amazeeio/redis
# labels:
# lagoon.type: redis
# environment:
# << : *default-environment
# solr:
# image: amazeeio/solr:6.6-drupal
# labels:
# lagoon.type: solr
# ports:
# - "8983" # exposes the port 8983 with a random local port, find it with `docker-compose port solr 8983`
# environment:
# << : *default-environment
drupal-varnish:
image: amazeeio/varnish-drupal
labels:
lagoon.type: varnish
links:
- nginx # links varnish to the nginx in this docker-compose project, or it would try to connect to any nginx running in docker
environment:
<< : *default-environment
VARNISH_BYPASS: "true" # by default we bypass varnish, change to 'false' or remove in order to use Varnish
LAGOON_LOCALDEV_URL: drupal-varnish.drupal-decoupled-app.docker.amazee.io # generate another route for varnish
networks:
- amazeeio-network
- default
networks:
amazeeio-network:
external: true