Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
121 lines (109 sloc) 2.86 KB
version: '2'
settings:
conductor:
base: 'centos:7'
volumes:
- temp-space:/tmp # Used to copy static content between containers
k8s_namespace:
name: demo
display_name: Ansible Container Demo
description: Django framework demo
defaults:
POSTGRES_USER: django
POSTGRES_PASSWORD: sesame
POSTGRES_DB: django
DJANGO_ROOT: /django
DJANGO_USER: django
DJANGO_PORT: 8080
DJANGO_VENV: /venv
NODE_USER: node
NODE_HOME: /node
NODE_ROOT: ''
GULP_DEV_PORT: 8080
services:
django:
from: 'centos:7'
roles:
- role: django-gunicorn
environment:
DATABASE_URL: 'pgsql://{{ POSTGRES_USER }}:{{ POSTGRES_PASSWORD }}@postgresql:5432/{{ POSTGRES_DB }}'
DJANGO_ROOT: '{{ DJANGO_ROOT }}'
DJANGO_VENV: '{{ DJANGO_VENV }}'
expose:
- '{{ DJANGO_PORT }}'
working_dir: '{{ DJANGO_ROOT }}'
links:
- postgresql
user: '{{ DJANGO_USER }}'
command: ['/usr/bin/dumb-init', '{{ DJANGO_VENV }}/bin/gunicorn', -w, '2', -b, '0.0.0.0:{{ DJANGO_PORT }}', 'project.wsgi:application']
entrypoint: [/usr/bin/entrypoint.sh]
dev_overrides:
volumes:
- '$PWD:{{ DJANGO_ROOT }}'
command: [/usr/bin/dumb-init, '{{ DJANGO_VENV }}/bin/python', manage.py, runserver, '0.0.0.0:{{ DJANGO_PORT }}']
depends_on:
- postgresql
gulp:
from: 'centos:7'
roles:
- role: gulp-static
working_dir: '{{ NODE_HOME }}'
command: ['/bin/false']
environment:
NODE_HOME: '{{ NODE_HOME }}'
dev_overrides:
entrypoint: [/entrypoint.sh]
command: [/usr/bin/dumb-init, /usr/local/bin/gulp]
ports:
- '8080:{{ GULP_DEV_PORT }}'
- 3001:3001
links:
- django
volumes:
- '$PWD:{{ NODE_HOME }}'
openshift:
state: absent
nginx:
from: 'centos:7'
roles:
- role: ansible.nginx-container
ASSET_PATHS:
- /tmp/dist
PROXY: yes
PROXY_PASS: 'http://django:8080'
PROXY_LOCATION: "~* /(admin|api)"
ports:
- '{{ DJANGO_PORT }}:8000'
links:
- django
dev_overrides:
ports: []
command: /bin/false
postgresql:
# Uses a pre-built postgresql image from Docker Hub
from: ansible/postgresql:latest
environment:
- 'POSTGRES_DB={{ POSTGRES_DB }}'
- 'POSTGRES_USER={{ POSTGRES_USER }}'
- 'POSTGRES_PASS={{ POSTGRES_PASSWORD }}'
- 'PGDATA=/var/lib/pgsql/data/userdata'
volumes:
- postgres-data:/var/lib/pgsql/data
expose:
- 5432
volumes:
postgres-data:
docker: {}
openshift:
access_modes:
- ReadWriteMany
requested_storage: 3Gi
temp-space:
docker: {}
openshift:
state: absent
registries:
local_openshift:
url: https://local.openshift # The push-to URL, created by chouseknecht.minishift-up role
namespace: demo
pull_from_url: 172.30.1.1:5000 # The pull-from URL from within minishift