-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
40 lines (37 loc) · 920 Bytes
/
docker-compose.yaml
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
services:
db:
container_name: postagram_db
image: postgres:14.3-alpine
env_file: .env
environment:
- POSTGRES_USER=unicorn
- POSTGRES_PASSWORD=wCh29&HE&T83
- POSTGRES_DB=nyatidb
volumes:
- postgres_data:/var/lib/postgresql/data/
- ./init-db:/docker-entrypoint-initdb.d
ports:
- "5436:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U unicorn -d nyatidb"]
interval: 5s
timeout: 5s
retries: 5
api:
container_name: postagram_api
build: .
restart: unless-stopped
env_file: .env
ports:
- "8081:8080"
command: >
sh -c "python manage.py migrate --no-input && gunicorn UnicornRoot.wsgi:application --bind 0.0.0.0:8080"
volumes:
- .:/app
- uploads_volume:/app/uploads
depends_on:
db:
condition: service_healthy
volumes:
uploads_volume:
postgres_data: