Preserving services and service settings¶
By default, only the global roles are started with a
launchpad project start.
If your project requires e.g. memcached or a non-default php version, h
every service or service setting passed with
launchpad project start can be used, see the documentation.
1 2 3 4 5 6 7 8 9
--- version: 1.0 services: - solr - varnish service_settings: docroot_folder: htdocs php_version: "5.6"
Extending and overriding docker-compose logic¶
As Launchpad manages the Docker stack of your project in the
docker-compose.yml, that file shouldn't be edited manually.
The normal way to override the Docker setup, is through a
docker-compose.override.yml, which allows you to e.g. vary based on OS.
But here is the caveat: Launchpad already uses the
docker-compose.override.yml to allow faster I/O on OSX, without bothering Linux users.
Fortunately there is a way to do this.
Docker-compose can handle extra files through a
-f flag (which defaults to
-f docker-compose.yml or
-f docker-compose.yml -f docker-compose.override.yml)
Launchpad takes advantage of this by adding a
-f docker-compose.local.yml to the command if that file exists.
That file isn't managed by Launchpad, so changes are persistent and that file can be comitted in your repo.
The lay-out of this file is the same as the
1 2 3 4 5 6 7
version: '3.5' services: ... networks: ...
overriding env vars¶
1 2 3 4
services: apache: environment: - AN_ENVIRONMENT_VARIABLE=a_value
mounting extra folders¶
This can be done with the following snippet:
1 2 3 4 5 6 7
services: shell: volumes: - ./a_folder:/var/www/html/a_folder:cached apache: volumes: - ./a_folder:/var/www/html/a_folder:cached
Be aware that the apache and shell container don't share the same volumes by default.
E.g. if you only need a folder in the shell, you can ommit the
Service specific overrides¶
A very interesting caveat: You can't remove config, only append. So there is no way of to e.g. replace all volumes of a specific service.