forked from skorokithakis/django-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
48 lines (45 loc) · 1.01 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
version: '3'
services:
redis:
image: redis
db:
image: postgres:10
stop_signal: SIGINT # Fast shutdown.
environment:
POSTGRES_PASSWORD: password
volumes:
- ./misc/dbdata:/var/lib/postgresql/data:delegated
web:
# Docker hack to wait until Postgres is up, then run stuff.
command: >
bash -c "while ! nc -w 1 -z db 5432;
do sleep 0.1;
done;
./manage.py migrate;
while :;
do exec ./manage.py runserver_plus 0.0.0.0:8000;
done;
"
image: "web"
build: .
stop_signal: SIGINT # The devserver only stops on SIGINT.
stdin_open: true
tty: true
volumes:
- .:/code:cached
ports:
- "8000:8000"
depends_on:
- db
- redis
environment:
IN_DOCKER: 1
webserver:
image: jumanjiman/caddy
depends_on:
- web
ports:
- "80:8000"
command: -conf /code/misc/caddyfile.conf
volumes:
- .:/code:cached