-
Notifications
You must be signed in to change notification settings - Fork 8
/
docker-compose.yml
43 lines (40 loc) · 982 Bytes
/
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
version: "3"
services:
db:
image: postgres
environment:
POSTGRES_DB: pollsdb
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- db_data:/var/lib/postgresql/data/
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 10s
timeout: 5s
retries: 5
web:
build: .
command: >
sh -c "cd polls/ &&
python manage.py makemigrations &&
python manage.py migrate &&
python manage.py collectstatic --noinput &&
python manage.py loaddata fixtures/initial_data.json &&
uwsgi --ini uwsgi.ini"
environment:
SECRET_KEY: mysecretkey
POSTGRES_DB: pollsdb
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
volumes:
- .:/code
- static_volume:/code/static
volumes:
db_data:
static_volume: