Created
August 22, 2021 19:57
-
-
Save youngsoul/aa2861ae7458d17a0a5b909666681a83 to your computer and use it in GitHub Desktop.
Makefile to help with postgres docker commands
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
| # Containers ids | |
| postgres-id=$(shell docker ps -a -q -f "name=postgres-container") | |
| # Stop docker containers | |
| stop-all: | |
| @docker-compose stop | |
| stop-db: | |
| -@docker stop $(postgres-id) | |
| # Remove docker containers | |
| rm-postgres: | |
| -@docker rm $(postgres-id) | |
| # Run docker containers | |
| run: | |
| @docker-compose -f docker-compose.yml up | |
| run-db: | |
| @docker-compose -f docker-compose.yml up db | |
| shell-postgres: | |
| @docker exec -it $(postgres-id) bash | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment