Skip to content

Instantly share code, notes, and snippets.

@rehmatworks
Created May 30, 2021 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rehmatworks/3cdae3c198188c860a2f1527c455b5d7 to your computer and use it in GitHub Desktop.
Save rehmatworks/3cdae3c198188c860a2f1527c455b5d7 to your computer and use it in GitHub Desktop.
Docker Swarm deploy a sample Flask app.
docker swarm init
docker service create --mode global --publish target=8000,published=80 serpsbot/flask-test
# Get join token for workers
docker swarm join-token worker
## Will return
docker swarm join --token xyz ip-address:port
## Execute this command on all worker nodes. We have deployed the service in global mode, so every worker that joins the cluser will
## get an instance of the service deployed on it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment