-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(compose): support for setting profiles (#738)
# Change Adds `profiles` support for docker compose. # Context I've had to use a workaround in a company project for compose profiles leading to multiple compose profile files. This should help by supporting profiles in compose which is a very handy feature when your service has some variety of ways to run (contextual, environmental, etc) Without this, it's still possible to run profiles buy setting the `COMPOSE_PROFILES` env variable, but this is certainly cleaner and easier on test writing. # Docker Docs https://docs.docker.com/compose/how-tos/profiles/#assigning-profiles-to-services
- Loading branch information
1 parent
24e354f
commit 3e00e71
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
services: | ||
runs-always: &simple-service | ||
image: alpine:latest | ||
init: true | ||
command: | ||
- sh | ||
- -c | ||
- 'while true; do sleep 0.1 ; date -Ins; done' | ||
runs-profile-a: | ||
<<: *simple-service | ||
profiles: | ||
- profile-a | ||
runs-profile-b: | ||
<<: *simple-service | ||
profiles: | ||
- profile-b |
This file contains 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