This repository has been archived by the owner on Sep 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathdocker-compose.yml
101 lines (92 loc) · 2.2 KB
/
docker-compose.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
version: '2'
services:
persistent_db:
image: postgres:9.4
volumes:
- database_data:/var/lib/postgresql/data
prod: &PROD
image: python:3.6.5
command: ./devops/wait_for_db_then ./devops/activate_then ./devops/run_webserver.sh
ports:
- 9000:9000
environment: &PROD_ENV
PORT: 9000
DJANGO_SETTINGS_MODULE: atf_eregs.settings.prod
DATABASE_URL: postgres://postgres@persistent_db/postgres
USE_LIVE_DATA: "true"
TMPDIR: /tmp
STATIC_ROOT: frontend_build
VCAP_APPLICATION: >
{"uris": ["localhost", "0.0.0.0", "127.0.0.1"]}
volumes:
- $PWD:/usr/src/app
- prod_libs:/usr/src/app/.venv/
working_dir: /usr/src/app
stdin_open: true
tty: true
depends_on:
- persistent_db
dev: &DEV
<<: *PROD
ports:
- 8000:8000
environment: &DEV_ENV
<<: *PROD_ENV
DEBUG: "true"
PORT: 8000
DJANGO_SETTINGS_MODULE: atf_eregs.settings.dev
volumes:
- $PWD:/usr/src/app
- dev_libs:/usr/src/app/.venv/
dev-with-db:
<<: *DEV
ports:
- 8001:8001
environment:
<<: *DEV_ENV
PORT: 8001
USE_LIVE_DATA: "false"
VCAP_APPLICATION: >
{"uris": ["localhost", "0.0.0.0", "127.0.0.1", "dev-with-db"]}
#---- Commands ----
manage.py:
<<: *DEV
entrypoint: ./devops/activate_then ./manage.py
command: ''
ports: []
py.test:
<<: *DEV
entrypoint: ./devops/activate_then py.test
command: ''
ports: []
flake8:
<<: *DEV
entrypoint: ./devops/activate_then flake8
command: ''
ports: []
pip-compile:
<<: *DEV
entrypoint: ./devops/activate_then pip-compile
command: ''
ports: []
bandit:
<<: *DEV
entrypoint: ./devops/activate_then bandit
command: ''
ports: []
grunt:
image: node:6
volumes:
- $PWD:/usr/src/app
- npm_libs:/usr/src/app/frontend_build/node_modules/
working_dir: /usr/src/app/frontend_build/
entrypoint: ../devops/deps_ok_then ./node_modules/.bin/grunt
psql:
image: postgres:9.4
entrypoint: 'psql -h persistent_db -U postgres'
depends_on: ['persistent_db']
volumes:
database_data:
prod_libs:
dev_libs:
npm_libs: