mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-26 08:20:38 +03:00
updates docker-compose format to version 2 #483
This commit is contained in:
parent
1d731ae48a
commit
45bbd27f39
|
@ -1,14 +1,19 @@
|
||||||
postgres:
|
version: '2'
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
image: postgres:9.5
|
image: postgres:9.5
|
||||||
volumes:
|
volumes:
|
||||||
# If you are using boot2docker, postgres data has to live in the VM for now until #581 is fixed
|
# 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
|
# for more info see here: https://github.com/boot2docker/boot2docker/issues/581
|
||||||
- /data/dev/{{cookiecutter.repo_name}}/postgres:/var/lib/postgresql/data
|
- /data/dev/{{cookiecutter.repo_name}}/postgres:/var/lib/postgresql/data
|
||||||
|
|
||||||
django:
|
django:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
dockerfile: Dockerfile-dev
|
dockerfile: Dockerfile-dev
|
||||||
build: .
|
|
||||||
command: python /app/manage.py runserver_plus 0.0.0.0:8000
|
command: python /app/manage.py runserver_plus 0.0.0.0:8000
|
||||||
|
depends_on:
|
||||||
|
- postgres
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
ports:
|
ports:
|
||||||
|
|
|
@ -1,43 +1,57 @@
|
||||||
postgres:
|
version: '2'
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
image: postgres:9.5
|
image: postgres:9.5
|
||||||
volumes:
|
volumes:
|
||||||
- /data/{{cookiecutter.repo_name}}/postgres:/var/lib/postgresql/data
|
- /data/{{cookiecutter.repo_name}}/postgres:/var/lib/postgresql/data
|
||||||
env_file: .env
|
env_file: .env
|
||||||
|
|
||||||
django:
|
django:
|
||||||
build: .
|
build:
|
||||||
|
context: .
|
||||||
user: django
|
user: django
|
||||||
links:
|
links:
|
||||||
- postgres
|
- postgres
|
||||||
- redis
|
- redis
|
||||||
command: /gunicorn.sh
|
command: /gunicorn.sh
|
||||||
env_file: .env
|
env_file: .env
|
||||||
|
depends_on:
|
||||||
|
- postgres
|
||||||
|
- redis
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
build: ./compose/nginx
|
build: ./compose/nginx
|
||||||
links:
|
links:
|
||||||
- django
|
- django
|
||||||
ports:
|
ports:
|
||||||
- "0.0.0.0:80:80"
|
- "0.0.0.0:80:80"
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:3.0
|
image: redis:3.0
|
||||||
{% if cookiecutter.use_celery == 'y' %}
|
{% if cookiecutter.use_celery == 'y' %}
|
||||||
celeryworker:
|
celeryworker:
|
||||||
build: .
|
build:
|
||||||
|
context: .
|
||||||
user: django
|
user: django
|
||||||
env_file: .env
|
env_file: .env
|
||||||
links:
|
links:
|
||||||
- postgres
|
- postgres
|
||||||
- redis
|
- redis
|
||||||
command: celery -A {{cookiecutter.repo_name}}.taskapp worker -l INFO
|
command: celery -A {{cookiecutter.repo_name}}.taskapp worker -l INFO
|
||||||
|
depends_on:
|
||||||
|
- postgres
|
||||||
|
- redis
|
||||||
|
|
||||||
celerybeat:
|
celerybeat:
|
||||||
build: .
|
build:
|
||||||
|
context: .
|
||||||
user: django
|
user: django
|
||||||
env_file: .env
|
env_file: .env
|
||||||
links:
|
links:
|
||||||
- postgres
|
- postgres
|
||||||
- redis
|
- redis
|
||||||
command: celery -A {{cookiecutter.repo_name}}.taskapp beat -l INFO
|
command: celery -A {{cookiecutter.repo_name}}.taskapp beat -l INFO
|
||||||
{% endif %}
|
depends_on:
|
||||||
|
- postgres
|
||||||
|
- redis
|
||||||
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user