-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
44 lines (42 loc) · 1.09 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
44 lines (42 loc) · 1.09 KB
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
services:
web:
container_name: notes_api_server
build: .
command: >
sh -c "
python manage.py migrate &&
python manage.py collectstatic --noinput &&
gunicorn --workers 3 --preload --bind 0.0.0.0:8000 --access-logfile - notes_api.wsgi:application
"
ports:
- 8000:8000
depends_on:
db:
condition: service_healthy
environment:
- DJANGO_DB_HOST=db
- DJANGO_DB_NAME=notes_api
- DJANGO_DB_USERNAME=postgres
- DJANGO_DB_PASSWORD=postgres
- 'DJANGO_SECRET_KEY=django-insecure-slj(_efp!da@c#xf+7th@54@0%8_+a#cd-)2&cop%g3_amr-51'
- DJANGO_DEBUG=False
volumes:
- .:/app
db:
image: postgres:14
container_name: notes_api_database
ports:
- 5432:5432
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=notes_api
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
timeout: 5s
retries: 5
volumes:
postgres_data: