Skip to content

Instantly share code, notes, and snippets.

@tobybellwood
Created August 2, 2018 21:15
Show Gist options
  • Save tobybellwood/9a7f7d69669b4086a463c20387e180d9 to your computer and use it in GitHub Desktop.
Save tobybellwood/9a7f7d69669b4086a463c20387e180d9 to your computer and use it in GitHub Desktop.
Sample SaaS+ dc file
version: '2.3'
x-lagoon-project:
# Lagoon project name (leave `&lagoon-project` when you edit this)
&lagoon-project govcms-lagoon-sassplus
x-volumes:
&default-volumes
# Define all volumes you would like to have real-time mounted into the docker containers
volumes:
- ./libraries:/app/sites/all/libraries:delegated
- ./modules:/app/sites/all/modules:delegated
- ./themes:/app/sites/all/themes/custom:delegated
- ./files:/app/sites/default/files:delegated
x-environment:
&default-environment
LAGOON_PROJECT: *lagoon-project
# Route that should be used locally
LAGOON_ROUTE: http://govcms-lagoon-sassplus.docker.amazee.io
# Uncomment if you like to have the system behave like in production
#LAGOON_ENVIRONMENT_TYPE: production
services:
cli: # cli container, will be used for executing composer and any local commands (drush, drupal, etc.)
build:
context: .
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/sites/default/files/ # location where the persistent storage should be mounted
lagoon.persistent: /app/sites/all/libraries/ # location where the persistent storage should be mounted
lagoon.persistent: /app/sites/all/modules/ # location where the persistent storage should be mounted
<< : *default-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: .
dockerfile: Dockerfile.nginx
args:
CLI_IMAGE: *lagoon-project # Inject the name of the cli image
labels:
lagoon.type: nginx-php-persistent
lagoon.persistent: /app/sites/default/files/ # define where the persistent storage should be mounted too
lagoon.persistent: /app/sites/all/libraries/ # location where the persistent storage should be mounted
lagoon.persistent: /app/sites/all/modules/ # location where the persistent storage should be mounted
<< : *default-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: govcms-lagoon-sassplus.docker.amazee.io # generate another route for nginx, by default we go to varnish
networks:
- amazeeio-network
- default
php:
build:
context: .
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/sites/default/files/ # define where the persistent storage should be mounted too
lagoon.persistent: /app/sites/all/libraries/ # location where the persistent storage should be mounted
lagoon.persistent: /app/sites/all/modules/ # location where the persistent storage should be mounted
<< : *default-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: govcms/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
networks:
amazeeio-network:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment