Optional services in a stack? #11

Closed
opened 2020-09-12 17:04:33 +00:00 by 3wordchant · 3 comments
Owner

Seems like there'd be a few apps where people might not always want All The Services, All The Time, e.g. people:

  • .. installing Mediawiki who don't want SimpleSAML (or who don't want the visual editor, but who they)
  • .. installing Matrix-synapse who don't want CoTURN?

Found an interesting approach:

# compose.yml
version: '2.1'
services:
  lb:
    image: nginx:1.13           
  db:
    image: redis:3.2.9

# compose.bb.yml
version: '2.1'
services:
  busy:
    image: busybox

export COMPOSE_FILE=compose.yml:compose.bb.yml
Seems like there'd be a few apps where people might not always want All The Services, All The Time, e.g. people: - .. installing Mediawiki who don't want SimpleSAML (or who don't want the visual editor, but who they) - .. installing Matrix-synapse who don't want CoTURN? Found [an interesting approach](https://stackoverflow.com/a/61107015): ``` # compose.yml version: '2.1' services: lb: image: nginx:1.13 db: image: redis:3.2.9 # compose.bb.yml version: '2.1' services: busy: image: busybox export COMPOSE_FILE=compose.yml:compose.bb.yml ```
Owner

Yeah that is quite nice. I was originally doing a docker-compose.yml/docker-compose.dev.yml/docker-compose.prod.yml thing but realised it is much easier to grok with a single file. This use case makes a lot of sense though. Maybe we could make a compose.d or something where we put optional services and then document or make abra support that?

Yeah that is quite nice. I was originally doing a `docker-compose.yml`/`docker-compose.dev.yml`/`docker-compose.prod.yml` thing but realised it is much easier to grok with a single file. This use case makes a lot of sense though. Maybe we could make a `compose.d` or something where we put optional services and then document or make `abra` support that?
Owner

Another approach is of course, a generator using cookiecutter / Jinja2 or something which asks you what you want when you generate the configuration. That speaks to a slightly more complicated and general solution which I don't really want to look into yet because it feels a bit YAGNI.

Another approach is of course, a generator using cookiecutter / Jinja2 or something which asks you what you want when you generate the configuration. That speaks to a slightly more complicated and general solution which I don't really want to look into yet because it feels a bit YAGNI.
Author
Owner

COMPOSE_FILE doesn't work with Swarm, but I added (slightly lazy..) handling in abra and it's working great e.g. for Mediawiki with SAML.

`COMPOSE_FILE` doesn't work with Swarm, but I [added (slightly lazy..) handling in `abra`](https://git.autonomic.zone/autonomic-cooperative/abra/commit/5a646abb1242f24b749a3ba4448191428b901d96) and it's working great e.g. for [Mediawiki with SAML](https://git.autonomic.zone/compose-stacks/mediawiki/src/branch/main/compose.simplesaml.yml).
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/organising#11
No description provided.