Skip to content

Instantly share code, notes, and snippets.

@AntonKosov
Last active January 6, 2024 14:32
Show Gist options
  • Save AntonKosov/6fc56740ede8544f99b2988bb21f7852 to your computer and use it in GitHub Desktop.
Save AntonKosov/6fc56740ede8544f99b2988bb21f7852 to your computer and use it in GitHub Desktop.
Managing Docker Compose Services
run:
@ls -1 -d */ | xargs -i sh -c 'cd {} && docker compose up -d'
stop:
@ls -1 -d */ | xargs -i sh -c 'cd {} && docker compose stop'
# GPG_TTY must be defined: GPG_TTY=$(tty) make backup
backup:
@$(MAKE) stop
@sudo tar -zcf - * | gpg --symmetric --cipher-algo aes256 -o backup-`date +%y-%m-%d`.tar.gz.gpg
@$(MAKE) run
upgrade:
@$(MAKE) stop
@ls -1 -d */ | xargs -i sh -c 'cd {} && docker compose build --pull'
@$(MAKE) run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment