updates docker-compose format to version 2 #483

This commit is contained in:
Aaron Eikenberry 2016-03-02 22:16:25 -06:00
parent 1d731ae48a
commit 45bbd27f39
2 changed files with 74 additions and 55 deletions

View File

@ -1,14 +1,19 @@
postgres:
version: '2'
services:
postgres:
image: postgres:9.5
volumes:
# If you are using boot2docker, postgres data has to live in the VM for now until #581 is fixed
# for more info see here: https://github.com/boot2docker/boot2docker/issues/581
- /data/dev/{{cookiecutter.repo_name}}/postgres:/var/lib/postgresql/data
django:
django:
build:
context: .
dockerfile: Dockerfile-dev
build: .
command: python /app/manage.py runserver_plus 0.0.0.0:8000
depends_on:
- postgres
volumes:
- .:/app
ports:

View File

@ -1,43 +1,57 @@
postgres:
version: '2'
services:
postgres:
image: postgres:9.5
volumes:
- /data/{{cookiecutter.repo_name}}/postgres:/var/lib/postgresql/data
env_file: .env
django:
build: .
django:
build:
context: .
user: django
links:
- postgres
- redis
command: /gunicorn.sh
env_file: .env
depends_on:
- postgres
- redis
nginx:
nginx:
build: ./compose/nginx
links:
- django
ports:
- "0.0.0.0:80:80"
redis:
redis:
image: redis:3.0
{% if cookiecutter.use_celery == 'y' %}
celeryworker:
build: .
{% if cookiecutter.use_celery == 'y' %}
celeryworker:
build:
context: .
user: django
env_file: .env
links:
- postgres
- redis
command: celery -A {{cookiecutter.repo_name}}.taskapp worker -l INFO
depends_on:
- postgres
- redis
celerybeat:
build: .
celerybeat:
build:
context: .
user: django
env_file: .env
links:
- postgres
- redis
command: celery -A {{cookiecutter.repo_name}}.taskapp beat -l INFO
{% endif %}
depends_on:
- postgres
- redis
{% endif %}