-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
docker-compose.dev.yml
130 lines (128 loc) · 4.03 KB
/
docker-compose.dev.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
version: "3"
######
# Configuration for https://dev.cornerwise.org
# In addition to the standard application/db/cache containers, this includes an
# nginx # container (nginx), a container that dynamically generates the nginx
# configuration (nginx-gen), and a container that automatically requests and
# renews the SSL certificate from Lets Encrypt. Finally, there is
# jsbuild container, which runs the JS/CSS build process and stores the
# results in the static_jsbuild volume.
services:
nginx:
image: nginx
container_name: nginx
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- nginx_conf:/etc/nginx/conf.d
- nginx_vhost:/etc/nginx/vhost.d
- nginx_html:/usr/share/nginx/html
- nginx_certs:/etc/nginx/certs
- ./docker-support/cornerwise.org_location.conf:/etc/nginx/vhost.d/default_location
- static_resources:/static
- media:/media
nginx-gen:
image: jwilder/docker-gen
container_name: nginx-gen
command: -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
restart: always
volumes:
- nginx_conf:/etc/nginx/conf.d
- nginx_vhost:/etc/nginx/vhost.d
- nginx_html:/usr/share/nginx/html
- nginx_certs:/etc/nginx/certs
- ./docker-support/nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro
- ./docker-support/cornerwise.org_location.conf:/etc/nginx/vhost.d/default_location
- /var/run/docker.sock:/tmp/docker.sock:ro
nginx-letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
restart: always
volumes:
- nginx_conf:/etc/nginx/conf.d
- nginx_vhost:/etc/nginx/vhost.d
- nginx_html:/usr/share/nginx/html
- nginx_certs:/etc/nginx/certs
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
NGINX_DOCKER_GEN_CONTAINER: nginx-gen
NGINX_PROXY_CONTAINER: nginx
jsbuild:
build:
context: ./docker-support
dockerfile: ./Dockerfile-jsbuild
image: bdsand/cornerwise_jsbuild
volumes:
- static_jsbuild:/static
- ./client:/client
environment:
CLIENT_DIR: "/client"
OUTPUT_DIR: "/static"
postgres:
image: mdillon/postgis:9.4-alpine
volumes:
- data:/var/lib/postgresql/data
redis:
image: redis:latest
volumes:
- redis_data:/data
cornerwise:
build: .
image: bdsand/cornerwise:latest
env_file:
- ./docker-support/common.env
- ./docker-support/dev.env
environment:
APP_MODE: "production"
ALLOWED_HOSTS: ".dev.cornerwise.org"
DJANGO_SERVE_STATIC: "0"
DJANGO_SERVE_MEDIA: "0"
GOOGLE_APPLICATION_CREDENTIALS: "/google_credentials.json"
VIRTUAL_HOST: "dev.cornerwise.org,somerville.dev.cornerwise.org,cambridge.dev.cornerwise.org"
LETSENCRYPT_HOST: "dev.cornerwise.org,somerville.dev.cornerwise.org,cambridge.dev.cornerwise.org"
LETSENCRYPT_EMAIL: "[email protected]"
ADMINS: "[email protected]"
SITE_REDIRECT: 1
CELERY_WORKER_COUNT: 1
SECURE_COOKIES: 1
expose:
- "3000"
links:
- postgres
- redis
restart: unless-stopped
working_dir: /app/
command: bash /app/start.sh
volumes:
- media:/media
- static_jsbuild:/static/build
- static_resources:/static_build
- ./server:/app
- ./client:/static
- ./server/cornerwise/google_dev_credentials.json:/google_credentials.json
- ./server/cornerwise/dev_local_settings.py:/app/cornerwise/local_settings.py
- ./docs/scraper-schema.json:/app/scraper-schema.json
volumes:
redis_data:
driver: local
data:
driver: local
media:
driver: local
nginx_conf:
driver: local
nginx_vhost:
driver: local
nginx_html:
driver: local
nginx_certs:
driver: local
# Built CSS and JS will go here:
static_jsbuild:
driver: local
# ./admin.py collectstatic will put static files here:
static_resources:
driver: local