Skip to content

Project customization

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-standard php version, you can specify it in the lauchpad configuration file, .dlp.yml and variants

.dlp.yml structure

every service or service setting passed with launchpad project start can be used, see the documentation.

---

version: 1.0
services:
 - solr
 - varnish
service_settings:
  docroot_folder: htdocs
  php_version: "5.6"

.dlp.yml variants

To support project, OS and personal configuration, there are 3 files that can be used to configure your project.
These files are merged together in the order below, so the configuration in the last file wins.

  • .dlp.yml: project specific configuration for all developers
  • .dlp.<OS>.yml: OS specific configuration
    • MacOS: .dlp.darwin.yml
    • Linux: .dlp.linux.yml
  • .dlp.local.yml: personal configuration

.dlp.local.yml is added to the .gitignore file automatically, as it should stay local.

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.

docker-compose.local.yml

The lay-out of this file is the same as the docker-compose.yml

version: '3.5'

services:
...

networks:
...

Examples

overriding env vars

services:
  apache:
    environment:
      - AN_ENVIRONMENT_VARIABLE=a_value

mounting extra folders

This can be done with the following snippet:

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 apache part.

Service specific overrides

Limitations

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.

This is a limitation in Docker compose. More informatation the documentation or the docker issue queue.