Skip to content

sophilabs/sample-django-docker-swarm

Repository files navigation

Sample Django app on Docker Swarm

A sample Django app to test Docker Swarm features.

Requirements

Installation in dev

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

Installation on a Swarm

1. Upload images

First thing to do is to upload the built images to Docker cloud.

docker login
docker-compose build
./upload-images.sh <account name>

2. Create Swarm via Docker Cloud

Then, you need to create your Docker Swarm by following the steps on Docker Cloud.

Docker Cloud Swarm creation

3. Connect to the Swarm

Once created, copy the command available to run the docker cloud client in your environment.

Docker Cloud connection to Swarm

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

4. Upload the stack

docker login
./deploy-stack.sh

5. Play and learn

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>

License

Sample Django on Docker Swarm is MIT Licensed. Copyright (c) 2017 Sophilabs, Inc.

Credits

https://s3.amazonaws.com/sophilabs-assets/logo/logo_300x66.gif

This tool is maintained and funded by Sophilabs, Inc. The names and logos for sophilabs are trademarks of sophilabs, inc.

About

A super-basic django app to try Docker Swarm.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published