Skip to content

Instantly share code, notes, and snippets.

@0atman 0atman/Makefile
Created Jul 2, 2018

Embed
What would you like to do?
A bootstrap makefile for docker-based projects
help: prerequisites
@echo "Usage: make [command]"
@echo "Commands:"
@echo "up Run server"
@echo "stop Stop server"
@echo "rebuild Rebuild docker image (when requirements change)"
@echo "ps Show running server"
@echo ""
@echo "Commands can be chained, for example: make up ps logs"
@echo ""
@echo "Advance Usage: run docker-compose [command] directly."
prerequisites:
@echo "checking requirements..."
@docker -v || (echo "Please install docker" && exit 1)
@docker-compose -v || (echo "Please install docker-compose (eg, pip install docker-compose)" && exit 1)
up: prerequisites
@docker-compose up -d
stop:
@docker-compose stop -t1
rebuild: prerequisites
@docker-compose build --no-cache
ps:
@docker-compose ps
logs:
@docker-compose logs -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.