Skip to content

Commit 8b2ed78

Browse files
committed
nginx: removing one step from readme no longer necessary...
2 parents 291528f + 91a3666 commit 8b2ed78

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

README.md

+20-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
### Django tutorial using Docker, Nginx, Gunicorn and PostgreSQL.
22

3-
Trying to learn Django, Gunicorn, Docker and Nginx all at the same time?
4-
This is the right repo!
3+
This is Django tutorial in steroids, I wanted to go through the tutorial using a configuration that is more close to production.
4+
5+
I am running the django app with gunicorn, using postgres as the database, the django app is behind nginx and everything is running out of Docker containers orchastrated with docker-compose.
56

67
At the moment I am in the [Part 2 of Django tutorial](https://docs.djangoproject.com/en/1.8/intro/tutorial02/), will continue the quest and update the git repo accordingly. (Getting docker-compose and nginx right took some time)
78

@@ -12,7 +13,7 @@ I am running this on a Macbook air running Yosemite with boot2docker.
1213
1. git clone this repo
1314
2. boot2docker up
1415
3. sh rebuild_docker.sh
15-
4. run migrations in your Django instance: docker-compose run django /bin/sh -c 'cd mysite;python manage.py migrate'
16+
4. run migrations in your Django instance: ```docker-compose run django /bin/sh -c 'cd mysite;python manage.py migrate'```
1617
5. access it in your browser! http://192.168.59.103/ for me, run boot2docker ip to know where it is running.
1718

1819
#### [docker-compose.yml](https://github.com/andrecp/django-tutorial-docker-nginx-postgres/blob/master/docker-compose.yml)
@@ -21,21 +22,28 @@ Compose is a tool for defining and running multi-container applications with Doc
2122
https://docs.docker.com/compose/
2223

2324
We have three containers: Nginx, Postgres and a Django App.
25+
2426
* django
25-
Built from ./Dockerfile, running gunicorn to serve our django app.
27+
28+
- Built from ./Dockerfile, running gunicorn to serve our django app.
29+
2630
* postgres
27-
Just the basic image from DockerRegistry
31+
- Just the basic image from DockerRegistry.
32+
2833
* nginx
29-
We are building it from nginx/Dockerfile, in our nginx/nginx.conf we are basically bypassing django and serving static files which gunicorn doesn't do for us.
34+
- We are building it from nginx/Dockerfile. In our nginx/nginx.conf we are basically proxying django to gunicorn and serving static files which gunicorn doesn't do for us.
3035

3136
#### rebuild_docker.sh
3237
Created to make life easier:
33-
1. docker-compose build
34-
Builds your docker-compose file
35-
2. docker-compose up -d
36-
Runs your containers on detached mode
37-
3. docker-compose ps
38-
Check if they are all running
38+
39+
1. Build your docker-compose file.
40+
- docker-compose build
41+
42+
2. Runs your containers on detached mode.
43+
- docker-compose up -d
44+
45+
3. Check if they are all running.
46+
- docker-compose ps
3947

4048
#### Important
4149
This project first started as me following the awesome introduction from Andrew T. Baker at the PyCon US 2015 [link](http://docker.atbaker.me/)

0 commit comments

Comments
 (0)