mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-26 00:10:42 +03:00
updates docker-compose format to version 2 #483
This commit is contained in:
parent
1d731ae48a
commit
45bbd27f39
|
@ -1,17 +1,22 @@
|
|||
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
|
||||
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:
|
||||
dockerfile: Dockerfile-dev
|
||||
build: .
|
||||
command: python /app/manage.py runserver_plus 0.0.0.0:8000
|
||||
volumes:
|
||||
- .:/app
|
||||
ports:
|
||||
- "8000:8000"
|
||||
links:
|
||||
- postgres
|
||||
django:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile-dev
|
||||
command: python /app/manage.py runserver_plus 0.0.0.0:8000
|
||||
depends_on:
|
||||
- postgres
|
||||
volumes:
|
||||
- .:/app
|
||||
ports:
|
||||
- "8000:8000"
|
||||
links:
|
||||
- postgres
|
||||
|
|
|
@ -1,43 +1,57 @@
|
|||
postgres:
|
||||
image: postgres:9.5
|
||||
volumes:
|
||||
- /data/{{cookiecutter.repo_name}}/postgres:/var/lib/postgresql/data
|
||||
env_file: .env
|
||||
version: '2'
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:9.5
|
||||
volumes:
|
||||
- /data/{{cookiecutter.repo_name}}/postgres:/var/lib/postgresql/data
|
||||
env_file: .env
|
||||
|
||||
django:
|
||||
build: .
|
||||
user: django
|
||||
links:
|
||||
- postgres
|
||||
- redis
|
||||
command: /gunicorn.sh
|
||||
env_file: .env
|
||||
django:
|
||||
build:
|
||||
context: .
|
||||
user: django
|
||||
links:
|
||||
- postgres
|
||||
- redis
|
||||
command: /gunicorn.sh
|
||||
env_file: .env
|
||||
depends_on:
|
||||
- postgres
|
||||
- redis
|
||||
|
||||
nginx:
|
||||
build: ./compose/nginx
|
||||
links:
|
||||
- django
|
||||
ports:
|
||||
- "0.0.0.0:80:80"
|
||||
nginx:
|
||||
build: ./compose/nginx
|
||||
links:
|
||||
- django
|
||||
ports:
|
||||
- "0.0.0.0:80:80"
|
||||
|
||||
redis:
|
||||
image: redis:3.0
|
||||
{% if cookiecutter.use_celery == 'y' %}
|
||||
celeryworker:
|
||||
build: .
|
||||
user: django
|
||||
env_file: .env
|
||||
links:
|
||||
- postgres
|
||||
- redis
|
||||
command: celery -A {{cookiecutter.repo_name}}.taskapp worker -l INFO
|
||||
redis:
|
||||
image: redis:3.0
|
||||
{% 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: .
|
||||
user: django
|
||||
env_file: .env
|
||||
links:
|
||||
- postgres
|
||||
- redis
|
||||
command: celery -A {{cookiecutter.repo_name}}.taskapp beat -l INFO
|
||||
{% endif %}
|
||||
celerybeat:
|
||||
build:
|
||||
context: .
|
||||
user: django
|
||||
env_file: .env
|
||||
links:
|
||||
- postgres
|
||||
- redis
|
||||
command: celery -A {{cookiecutter.repo_name}}.taskapp beat -l INFO
|
||||
depends_on:
|
||||
- postgres
|
||||
- redis
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue
Block a user