Skip to content

Instantly share code, notes, and snippets.

@pyldin601
Last active September 21, 2018 09:53
Show Gist options
  • Save pyldin601/9de8b6598e919633b57a4c5be4fecf05 to your computer and use it in GitHub Desktop.
Save pyldin601/9de8b6598e919633b57a4c5be4fecf05 to your computer and use it in GitHub Desktop.
Generic Makefile for docker swarm service
IMAGE_NAME := superorder/superorder-datafeed
CONTAINER_NAME := superorder-datafeed
SERVICE_NAME := superorder_datafeed
TAG := latest
docker-build:
docker build -t $(IMAGE_NAME):$(TAG) .
docker-start:
docker run -it --name $(CONTAINER_NAME) --rm $(IMAGE_NAME):$(TAG)
docker-push:
docker push $(IMAGE_NAME):$(TAG)
deploy:
ssh $(DEPLOY_HOST) -- docker service update --force --with-registry-auth --image=$(IMAGE_NAME):$(TAG) $(SERVICE_NAME)
.PHONY: deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment