Skip to content

feat: update docker version #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

Featuring:

- Docker v1.10.3
- Docker Compose v1.6.2
- Docker Machine v0.6.0
- Python 3.5
- Docker v18.09.2
- Docker Compose v1.23.2
- Docker Machine v0.16.1
- Python 3.7.3

Blog post -> https://realpython.com/blog/python/django-development-with-docker-compose-and-machine/

Expand Down
87 changes: 47 additions & 40 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,50 @@
web:
restart: always
build: ./web
expose:
- "8000"
links:
- postgres:postgres
- redis:redis
volumes:
- /usr/src/app
- /usr/src/app/static
env_file: .env
environment:
DEBUG: 'true'
command: /usr/local/bin/gunicorn docker_django.wsgi:application -w 2 -b :8000
version: '3'

nginx:
restart: always
build: ./nginx/
ports:
- "80:80"
volumes:
- /www/static
volumes_from:
- web
links:
- web:web
services:
web:
restart: always
build: ./web
expose:
- "8000"
links:
- postgres:postgres
- redis:redis
volumes:
- web-django:/usr/src/app
- web-static:/usr/src/app/static
env_file: .env
environment:
DEBUG: 'true'
command: /usr/local/bin/gunicorn docker_django.wsgi:application -w 2 -b :8000

postgres:
restart: always
image: postgres:latest
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data/
nginx:
restart: always
build: ./nginx/
ports:
- "80:80"
volumes:
- web-static:/www/static
links:
- web:web

redis:
restart: always
image: redis:latest
ports:
- "6379:6379"
volumes:
- redisdata:/data
postgres:
restart: always
image: postgres:latest
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data/

redis:
restart: always
image: redis:latest
ports:
- "6379:6379"
volumes:
- redisdata:/data

volumes:
web-django:
web-static:
pgdata:
redisdata:
4 changes: 3 additions & 1 deletion nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
FROM tutum/nginx

RUN rm /etc/nginx/sites-enabled/default
ADD sites-enabled/ /etc/nginx/sites-enabled

COPY sites-enabled/ /etc/nginx/sites-enabled
80 changes: 43 additions & 37 deletions production.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,46 @@
web:
restart: always
build: ./web
expose:
- "8000"
links:
- postgres:postgres
- redis:redis
volumes:
- /usr/src/app/static
env_file: .env
command: /usr/local/bin/gunicorn docker_django.wsgi:application -w 2 -b :8000
version: '3'

nginx:
restart: always
build: ./nginx/
ports:
- "80:80"
volumes:
- /www/static
volumes_from:
- web
links:
- web:web
services:
web:
restart: always
build: ./web
expose:
- "8000"
links:
- postgres:postgres
- redis:redis
volumes:
- web-static:/usr/src/app/static
env_file: .env
command: /usr/local/bin/gunicorn docker_django.wsgi:application -w 2 -b :8000

postgres:
restart: always
image: postgres:latest
ports:
- "5432"
volumes:
- pgdata:/var/lib/postgresql/data/
nginx:
restart: always
build: ./nginx/
ports:
- "80:80"
volumes:
- web-static:/www/static
links:
- web:web

redis:
restart: always
image: redis:latest
ports:
- "6379"
volumes:
- redisdata:/data
postgres:
restart: always
image: postgres:latest
ports:
- "5432"
volumes:
- pgdata:/var/lib/postgresql/data/

redis:
restart: always
image: redis:latest
ports:
- "6379"
volumes:
- redisdata:/data

volumes:
web-static:
pgdata:
redisdata:
9 changes: 8 additions & 1 deletion web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
FROM python:3.5-onbuild
FROM python:3.7-slim

RUN python -m pip install --upgrade pip

COPY requirements.txt requirements.txt
RUN python -m pip install -r requirements.txt

COPY . .
4 changes: 2 additions & 2 deletions web/docker_django/apps/todo/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.conf.urls import url
from django.urls import re_path

from . import views

urlpatterns = [
url(r'^$', views.home, name='home'),
re_path(r'^$', views.home, name='home'),
]
6 changes: 3 additions & 3 deletions web/docker_django/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.conf.urls import include, url
from django.urls import include, re_path
from django.contrib import admin

urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^', include('docker_django.apps.todo.urls')),
re_path(r'^admin/', admin.site.urls),
re_path(r'^', include('docker_django.apps.todo.urls')),
]
8 changes: 4 additions & 4 deletions web/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Django==1.8.1
gunicorn==19.3.0
psycopg2==2.6
redis==2.10.3
Django==2.1.7
gunicorn==19.9.0
psycopg2==2.7.7
redis==3.2.1