-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
53 lines (50 loc) · 1.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
version: '3.9'
volumes:
static:
db-data:
services:
db:
image: postgres:14.2
ports:
- 5432:5432
volumes:
- db-data:/var/lib/postgresql/data/
environment:
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_DB: "${POSTGRES_DB}"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}" ]
interval: 5s
timeout: 3s
retries: 6
demo:
image: findsimilar/demo
build:
context: .
expose:
- 8080
volumes:
- static:/static/
environment:
PGDB: "${POSTGRES_DB}"
PGUSER: "${POSTGRES_USER}"
PGPASSWORD: "${POSTGRES_PASSWORD}"
command: bash -c "
python manage.py migrate --settings=demo.prod_settings
&& python manage.py collectstatic --noinput --settings=demo.prod_settings
&& python manage.py load_examples --settings=demo.prod_settings
&& gunicorn demo.wsgi -b 0.0.0.0:8080
"
depends_on:
db:
condition: service_healthy
nginx:
image: findsimilar/demo-nginx
build: ./nginx
ports:
- 8000:80
volumes:
- static:/etc/nginx/static/
depends_on:
- demo