A sample Django app to test Docker Swarm features.
- Docker
- A Docker Cloud account (https://cloud.docker.com)
git clone https://github.com/sophilabs/sample-django-docker-swarm.git
docker-compose build
Run the app in your local environment
docker-compose up -d
Navigate to http://localhost
First thing to do is to upload the built images to Docker cloud.
docker login
docker-compose build
./upload-images.sh <account name>
Then, you need to create your Docker Swarm by following the steps on Docker Cloud.
Once created, copy the command available to run the docker cloud client in your environment.
It will require changing the DOCKER_HOST environment variable.
export DOCKER_HOST=tcp://127.0.0.1:<port>
Check you are connected to the swarm by listing the Swarm nodes.
docker node ls
docker login
./deploy-stack.sh
You can modify many aspects of your running services. Run :bash:`docker service update --help` to see a list of options.
Update service image
docker service update --image <account>/<image>:<tag> <service>
Update service replicas
docker service update --replicas <number> <service>
Sample Django on Docker Swarm is MIT Licensed. Copyright (c) 2017 Sophilabs, Inc.
This tool is maintained and funded by Sophilabs, Inc. The names and logos for sophilabs are trademarks of sophilabs, inc.