Skip to content

grahamhoyes/django-docker-swarm-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Docker Swarm Example

An example project for deploying Django on Docker Swarm.

Read the full documentation with a detailed walkthrough at https://django-docker-swarm-example.readthedocs.io/en/latest/.

This is primarily a playground and documentation for IEEE UofT's deployment needs to serve our hackathon template. As such, the requirements are:

  • Runs on a single server, but the option to add more nodes in the future is preferred
  • Postgres is installed natively on the server
  • Nginx is installed natively on the server, handling SSL and static file serving. We were using Apache, but after trying to get the reverse proxy for this tutorial to work properly we gave up and switched to Nginx. Would recommend.
  • The application should be deployed as a docker container that Apache/Nginx can reverse proxy to

This project walks through installing a postgres server, nginx, docker engine, and initializing Docker Swarm on a single machine (i.e., we will be creating a Swarm cluster with a single node).

This project does not:

  • Use Docker Machine, because my use case is running on an existing server.
  • Expose the Docker API. All remote connections will be made over SSH.

Credits

The following resources were a great help in developing this example: