title | author | date |
---|---|---|
cms |
Zachary Wilson |
2017-08-26 00:00:00 UTC |
A lightweight, ready-to-deploy, containerized content management system and "production-ready" stack environment implementing recommended deployment best practices.
git clone https://github.com/retool-solutions/cms
Docker Containers!
- Gunicorn WSGI serving Django CMS
- Networked to PostgreSQL Database instance
- Proxied to port 80 by NGINX webserver
- Docker CE
- AWS EC2 instance created w/
docker-machine
Go from localhost to the host you love most.
$ eval $(docker-machine env production)
$ docker stack deploy -c docker-compose.yml stack
I'm working on making deployment happen w/o manual intervention. For now, there are a few manual steps required before deploying this stack to a server for the first time, namely:
- NGINX configuration file must exist either in the image or on the server where the containers will be deployed
- After deploying the stack, you must migrate your django db and create a new superuser to log into the admin site
These are described in further detail below.
Copy ./config/nginx/default.conf
to the server
$ cd ./config/nginx
$ docker-machine scp default.conf production:~
$ docker-machine ssh production docker config create default.conf /users/home/ubuntu/default.conf
Where server
is the name of the production server.
Deploy the stack
eval (docker-machine env production)
docker stack deploy -c docker-compose.yml stack
Migrate your db
docker exec stack_app_1 python manage.py migrate
Create a new superuser
docker exec -it stack_app_1 python manage.py createsuperuser
-
Minimal NGINX configuration for WSGI applications
-
Using NGINX as a reverse proxy over tcp
-
Deploying a simple python app (Flask) w/ Gunicorn and NGINX
http://flask.pocoo.org/docs/0.12/deploying/wsgi-standalone/#proxy-setups
-
Docker compose version 3 file reference
-
Building python images
-
Integrating PostgreSQL db