-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
45 lines (37 loc) · 819 Bytes
/
Copy pathcompose.yaml
File metadata and controls
45 lines (37 loc) · 819 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
44
45
services:
api:
build: .
container_name: docker-task-api
ports:
- "3000:3000"
environment:
PORT: 3000
DB_HOST: database
DB_PORT: 5432
DB_NAME: tasks
DB_USER: postgres
DB_PASSWORD: postgres
depends_on:
database:
condition: service_healthy
database:
image: postgres:17
container_name: docker-task-database
environment:
POSTGRES_DB: tasks
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U postgres -d tasks"
]
interval: 5s
timeout: 5s
retries: 5
volumes:
postgres_data: