-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
43 lines (41 loc) · 917 Bytes
/
docker-compose.yml
File metadata and controls
43 lines (41 loc) · 917 Bytes
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
services:
db:
image: postgres:15
container_name: country_db
environment:
POSTGRES_USER: country_db
POSTGRES_PASSWORD: country_db
POSTGRES_DB: country_db
ports:
- "25432:5432"
volumes:
- postgres_country:/var/lib/postgresql/data
networks:
- country_project
healthcheck:
test: ["CMD-SHELL", "pg_isready -U country_db"]
interval: 5s
timeout: 2s
retries: 5
app:
build:
context: .
dockerfile: Dockerfile
container_name: country-app
depends_on:
db:
condition: service_healthy
ports:
- "7888:7888"
networks:
- country_project
command: >
sh -c "chmod +x /app/scripts/init-db.sh &&
bash -x /app/scripts/init-db.sh ||
{ echo 'DB initialization failed'; exit 1; } &&
./main
"
volumes:
postgres_country:
networks:
country_project: