Last active
November 16, 2020 16:33
-
-
Save otobrglez/fba7a111501a6d519c7301cd54c0c85b to your computer and use it in GitHub Desktop.
My "micro" wrapper for docker-compose
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
#!/usr/bin/env bash | |
set -e | |
# Author: Oto Brglez, <otobrglez@gmail.com> | |
# "MY_PROJECT_HOME" - is environment variable, usually set with | |
# something like direnv (via .env) or let to developer | |
if [[ -z "${MY_PROJECT_HOME}" ]]; then | |
echo "MY_PROJECT_HOME environment variable is not set!" && exit 255 | |
fi | |
# Always change directory to "project" folder and spawn | |
# docker-compose from there. Then pass all flags to compose | |
cd $MY_PROJECT_HOME && \ | |
docker-compose \ | |
-f .docker/docker-compose.dev.yml \ | |
--project-name acme-project \ | |
--project-directory . $@ | |
# Usage: | |
# ./bin/my-project-dev.sh up | |
# ./bin/my-project-dev.sh ls | |
# ./bin/my-project-dev.sh ps --all | |
# ./bin/my-project-dev.sh exec container bash | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment