add docker compose profiles support#163
Merged
bibendi merged 3 commits intobibendi:masterfrom May 14, 2023
Merged
Conversation
```
full:
description: Run all services
runner: docker_compose
compose:
profiles: [workers, backend]
```
Config like this will run `docker compose --profile workers --profile backend up`
command. Run options and service configs are ignored even if provided.
Can also be a part of subcommand:
```
rails:
description: Run Rails commands
service: backend
command: bundle exec rails
subcommands:
all:
description: Run Rails server, Sidekiq and RabbitMQ workers
compose:
profiles: [workers, backend]
```
There is an issue with Ctrl+C command in this case:
```
...
Aborting on container exit...
[+] Running 9/9
✔ Container app-realtime-1 Stopped 10.4s
✔ Container app Stopped 0.3s
✔ Container app-rabbitmq-1 Stopped 1.3s
✔ Container app-sidekiq-1 Stopped 10.3s
✔ Container app-faye-1 Stopped 0.2s
✔ Container app-mongodb-1 Stopped 0.2s
✔ Container app-memcached-1 Stopped 0.2s
✔ Container app-database-1 Stopped 1.9s
✔ Container app-redis-1 Stopped 0.1s
canceled
$ docker container ls --all
CONTAINER ID IMAGE COMMAND CREATED STATUS NAMES
67475bb645b3 app-dev:latest "/app/.dockerdev/ent…" About a minute ago Exited (137) 24 seconds ago app-realtime-1
47ab521ae5c7 app-dev:latest "/app/.dockerdev/ent…" About a minute ago Exited (137) 24 seconds ago app-sidekiq-1
22e7a9bd7faf app-dev:latest "/app/.dockerdev/ent…" About a minute ago Exited (1) 34 seconds ago app
c96e42e35f18 srv-faye:latest "docker-entrypoint.s…" About a minute ago Exited (0) 24 seconds ago app-faye-1
1816e2dfac59 rabbitmq:3.9.7-management "docker-entrypoint.s…" About a minute ago Exited (0) 33 seconds ago app-rabbitmq-1
6fc9360684fc memcached:1.5.22-alpine "docker-entrypoint.s…" About a minute ago Exited (0) 24 seconds ago app-memcached-1
aa9bde5cf18e redis:5-bullseye "docker-entrypoint.s…" About a minute ago Exited (0) 24 seconds ago app-redis-1
677beebb60a2 mariadb:10.2 "docker-entrypoint.s…" About a minute ago Exited (0) 22 seconds ago app-database-1
014529fd2f5e mongo:4.4.8 "docker-entrypoint.s…" About a minute ago Exited (0) 24 seconds ago app-mongodb-1
```
I.e. on Ctrl+C, containers are not removed. So, the next `dip up`
command may raise an error about missing network. To resolve, `dip down`
can be used. Also, `dip down` was slightly updated to remove orphan
containers by adding `--remove-orphans` flag.
Owner
|
Hi, Alexey! |
Contributor
Author
|
No worries Michael :) |
bibendi
reviewed
May 14, 2023
Owner
|
Thank you! Rolled v7.6.0 out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Config like this will run
docker compose --profile workers --profile backend upcommand. Run optionsand serviceconfigs are ignored even if provided. Can also be a part of subcommand:There is an issue with Ctrl+C command in this case:
I.e. on Ctrl+C, containers are not removed. So, the next
dip upcommand may raise an error about missing network. To resolve,dip downcan be used. Also,dip downwas slightly updated to remove orphan containers by adding--remove-orphansflag.Related tickets
What's inside
--remove-orphansflag for thedip downcommandChecklist: