Merge branch 'docker-compose-v2' of https://github.com/aeikenberry/cookiecutter-django into aeikenberry-docker-compose-v2

This commit is contained in:
Jannis Gebauer 2016-03-08 10:09:06 +01:00
commit 5ea6258d0d
3 changed files with 84 additions and 55 deletions

View File

@ -6,12 +6,22 @@ services:
- docker
language: python
python: 3.5
env:
- TOX_ENV=py27
- TOX_ENV=py34
- TOX_ENV=py35
before_install:
- sudo apt-get update
- sudo apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" docker-engine=1.10.1-0~trusty
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/1.6.0/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
script:
- tox -e $TOX_ENV
- sh tests/test_docker.sh

View File

@ -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

View File

@ -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 %}