Skip to content

Instantly share code, notes, and snippets.

@TimKraemer
Created January 22, 2023 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TimKraemer/a2e7b06e7cae66aaa8cf78db6a1322cc to your computer and use it in GitHub Desktop.
Save TimKraemer/a2e7b06e7cae66aaa8cf78db6a1322cc to your computer and use it in GitHub Desktop.
docker-compose wrapper for multiple yaml config files
#!/bin/bash
# put this to /usr/local/bin/dc
command="$(which docker-compose) -f /opt/services/docker-compose.yaml"
for f in $(find /opt/services -maxdepth 1 -type f -name "*.yaml" 2>/dev/null); do
[[ ${f} =~ "docker-compose.yaml" ]] && continue
command="${command} -f ${f}"
done
${command} "${@}"
@TimKraemer
Copy link
Author

written by @jkuettner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment