|
| 1 | +version: '2.3' |
| 2 | + |
| 3 | +x-lagoon-project: |
| 4 | + # Lagoon project name (leave `&lagoon-project` when you edit this) |
| 5 | + &lagoon-project drupal_ch |
| 6 | + |
| 7 | +x-volumes: |
| 8 | + &default-volumes |
| 9 | + # Define all volumes you would like to have real-time mounted into the docker containers |
| 10 | + volumes: |
| 11 | + - .:/app:delegated |
| 12 | + |
| 13 | +x-environment: |
| 14 | + &default-environment |
| 15 | + LAGOON_PROJECT: *lagoon-project |
| 16 | + # Route that should be used locally |
| 17 | + LAGOON_ROUTE: http://drupal-ch.docker.amazee.io |
| 18 | + # Uncomment if you like to have the system behave like in production |
| 19 | + #LAGOON_ENVIRONMENT_TYPE: production |
| 20 | + # Uncomment to enable xdebug and then restart via `docker-compose up -d` |
| 21 | + #XDEBUG_ENABLE: "true" |
| 22 | + |
| 23 | + |
| 24 | +services: |
| 25 | + |
| 26 | + cli: # cli container, will be used for executing composer and any local commands (drush, drupal, etc.) |
| 27 | + build: |
| 28 | + context: . |
| 29 | + dockerfile: lagoon/cli.dockerfile |
| 30 | + image: *lagoon-project # this image will be reused as `CLI_IMAGE` in subsequent Docker builds |
| 31 | + labels: |
| 32 | + # Lagoon Labels |
| 33 | + lagoon.type: cli-persistent |
| 34 | + lagoon.persistent.name: nginx # mount the persistent storage of nginx into this container |
| 35 | + lagoon.persistent: /app/docroot/sites/default/files/ # location where the persistent storage should be mounted |
| 36 | + << : *default-volumes # loads the defined volumes from the top |
| 37 | + volumes_from: # mount the ssh-agent from the pygmy or cachalot ssh-agent |
| 38 | + - container:amazeeio-ssh-agent |
| 39 | + environment: |
| 40 | + << : *default-environment # loads the defined environment variables from the top |
| 41 | + ports: |
| 42 | + - "1234" # exposes the port 1234 with a random local port, find it with `docker-compose port cli 1234` |
| 43 | + extra_hosts: |
| 44 | + - "drupal-ch.docker.amazee.io:172.17.0.1" |
| 45 | + |
| 46 | + nginx: |
| 47 | + build: |
| 48 | + context: . |
| 49 | + dockerfile: lagoon/nginx.dockerfile |
| 50 | + args: |
| 51 | + CLI_IMAGE: *lagoon-project # Inject the name of the cli image |
| 52 | + labels: |
| 53 | + lagoon.type: nginx-php-persistent |
| 54 | + lagoon.persistent: /app/docroot/sites/default/files/ # define where the persistent storage should be mounted too |
| 55 | + << : *default-volumes # loads the defined volumes from the top |
| 56 | + depends_on: |
| 57 | + - cli # basically just tells docker-compose to build the cli first |
| 58 | + environment: |
| 59 | + << : *default-environment # loads the defined environment variables from the top |
| 60 | + LAGOON_LOCALDEV_URL: nginx.drupal-ch.docker.amazee.io # generate another route for nginx, by default we go to varnish |
| 61 | + networks: |
| 62 | + - amazeeio-network |
| 63 | + - default |
| 64 | + |
| 65 | + php: |
| 66 | + build: |
| 67 | + context: . |
| 68 | + dockerfile: lagoon/php.dockerfile |
| 69 | + args: |
| 70 | + CLI_IMAGE: *lagoon-project |
| 71 | + labels: |
| 72 | + lagoon.type: nginx-php-persistent |
| 73 | + lagoon.name: nginx # we want this service be part of the nginx pod in Lagoon |
| 74 | + lagoon.persistent: /app/docroot/sites/default/files/ # define where the persistent storage should be mounted too |
| 75 | + << : *default-volumes # loads the defined volumes from the top |
| 76 | + depends_on: |
| 77 | + - cli # basically just tells docker-compose to build the cli first |
| 78 | + environment: |
| 79 | + << : *default-environment # loads the defined environment variables from the top |
| 80 | + |
| 81 | + |
| 82 | + mariadb: |
| 83 | + image: amazeeio/mariadb-drupal |
| 84 | + labels: |
| 85 | + lagoon.type: mariadb |
| 86 | + ports: |
| 87 | + - "3306" # exposes the port 3306 with a random local port, find it with `docker-compose port mariadb 3306` |
| 88 | + environment: |
| 89 | + << : *default-environment |
| 90 | + |
| 91 | + ## Uncomment for Redis |
| 92 | + # redis: |
| 93 | + # image: amazeeio/redis |
| 94 | + # labels: |
| 95 | + # lagoon.type: redis |
| 96 | + # environment: |
| 97 | + # << : *default-environment |
| 98 | + |
| 99 | + ## Uncomment for Solr |
| 100 | + # solr: |
| 101 | + # image: amazeeio/solr:6.6-drupal |
| 102 | + # labels: |
| 103 | + # lagoon.type: solr |
| 104 | + # ports: |
| 105 | + # - "8983" # exposes the port 8983 with a random local port, find it with `docker-compose port solr 8983` |
| 106 | + # environment: |
| 107 | + # << : *default-environment |
| 108 | + |
| 109 | + varnish: |
| 110 | + image: amazeeio/varnish-drupal |
| 111 | + labels: |
| 112 | + lagoon.type: varnish |
| 113 | + links: |
| 114 | + - nginx # links varnish to the nginx in this docker-compose project, or it would try to connect to any nginx running in docker |
| 115 | + environment: |
| 116 | + << : *default-environment |
| 117 | + VARNISH_BYPASS: "true" # by default we bypass varnish, change to 'false' or remove in order to tell varnish to cache if possible |
| 118 | + networks: |
| 119 | + - amazeeio-network |
| 120 | + - default |
| 121 | + |
| 122 | +networks: |
| 123 | + amazeeio-network: |
| 124 | + external: true |
0 commit comments