This repository has been archived by the owner on May 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
container.yml
63 lines (63 loc) · 1.63 KB
/
container.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
version: "2"
settings:
conductor_base: centos:7
defaults:
POSTGRES_USER: django
POSTGRES_PASSWORD: sesame
POSTGRES_DB: django
DJANGO_PORT: 8080
services:
django:
from: centos:7
roles:
- django-gunicorn
environment:
DATABASE_URL: "pgsql://{{ POSTGRES_USER }}:{{ POSTGRES_PASSWORD }}@postgres:5432/{{ POSTGRES_DB }}"
DJANGO_ROOT: '{{ DJANGO_ROOT }}'
DJANGO_VENV: '{{ DJANGO_VENV }}'
links:
- postgres
- postgres:postgresql
ports:
- '{{ DJANGO_PORT }}'
working_dir: '{{ DJANGO_ROOT }}'
user: '{{ DJANGO_USER }}'
command: ['{{ DJANGO_VENV }}/bin/gunicorn', '-w', '2', '-b', '0.0.0.0:{{ DJANGO_PORT }}', 'project.wsgi:application']
entrypoint: ['/usr/bin/dumb-init', '/usr/bin/entrypoint.sh']
volumes:
- 'static:{{ DJANGO_ROOT }}'
dev_overrides:
command: ['{{ DJANGO_VENV }}/bin/python', 'manage.py', 'runserver', '0.0.0.0:{{ DJANGO_PORT }}']
volumes:
- '${PWD}:{{ DJANGO_ROOT }}'
- "static:/static"
expose:
- "{{ DJANGO_PORT }}"
environment:
DEBUG: "1"
nginx:
from: centos:7
roles:
- nginx
ports:
- '{{ DJANGO_PORT }}:8000'
user: nginx
links:
- django
command: ['/usr/bin/dumb-init', 'nginx', '-c', '/etc/nginx/nginx.conf']
volumes:
- 'static:{{ STATIC_ROOT }}'
dev_overrides:
ports: []
command: /bin/false
volumes: []
postgres:
from: postgres:9.6
environment:
POSTGRES_USER: "{{ POSTGRES_USER }}"
POSTGRES_PASSWORD: "{{ POSTGRES_PASSWORD }}"
POSTGRES_DB: "{{ POSTGRES_DB }}"
volumes:
static:
docker: {}
registries: {}