-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdocker-compose.yml
48 lines (45 loc) · 1.02 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.6'
services:
db:
image: postgres:11.6
environment:
POSTGRES_PASSWORD: password
volumes:
- ./db_data:/var/lib/postgresql/data
ports:
- "5432:5432"
web:
# Docker hack to wait until postgres is up
command: >
bash -c "while ! nc -w 1 -z db 5432;
do sleep 0.3;
done;
./manage.py migrate;
./manage.py collectstatic --noinput;
exec /usr/local/bin/uwsgi --chdir=/code --ini=/code/uwsgi.ini"
build: .
image: martianpins
volumes:
- .:/code
- /tmp/martianpins:/tmp
ports:
- "5000:5000"
depends_on:
- db
env_file:
- ./.env
worker:
command: >
bash -c "while ! nc -w 1 -z db 5432;
do sleep 0.3;
done;
exec /usr/local/bin/python /code/manage.py process_tasks"
build: .
image: martianpins
volumes:
- .:/code
- /tmp/martianpins:/tmp
depends_on:
- db
env_file:
- ./.env