-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
34 lines (32 loc) · 884 Bytes
/
docker-compose.yml
File metadata and controls
34 lines (32 loc) · 884 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
services:
app:
build:
context: .
dockerfile: Dockerfile
depends_on:
db:
condition: service_healthy
environment:
TASK_MANAGER_HTTP_ADDR: :8080
TASK_MANAGER_DATABASE_URL: postgres://taskmanager:taskmanager@db:5432/taskmanager?sslmode=disable
ports:
- "8081:8080"
restart: unless-stopped
db:
image: postgres:17-alpine
environment:
POSTGRES_DB: taskmanager
POSTGRES_USER: taskmanager
POSTGRES_PASSWORD: taskmanager
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 5s
timeout: 5s
retries: 10
start_period: 5s
restart: unless-stopped
volumes:
- postgres_data:/var/lib/postgresql/data
- ./migrations/0001_init_tasks.sql:/docker-entrypoint-initdb.d/0001_init_tasks.sql:ro
volumes:
postgres_data: