-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
50 lines (47 loc) · 1.48 KB
/
Copy pathdocker-compose.yml
File metadata and controls
50 lines (47 loc) · 1.48 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
45
46
47
48
49
50
version: "3.9"
services:
# ── PostgreSQL ──────────────────────────────────────────────
db:
image: postgres:16-alpine
restart: unless-stopped
container_name: taskflow-db
ports:
- "${PG_PORT:-5432}:5432"
environment:
POSTGRES_USER: ${PG_USER:-taskflow}
POSTGRES_PASSWORD: ${PG_PASSWORD:-taskflow}
POSTGRES_DB: ${PG_DATABASE:-taskflow}
volumes:
- pgdata:/var/lib/postgresql/data
- ./migrations:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${PG_USER:-taskflow} -d ${PG_DATABASE:-taskflow}"]
interval: 3s
timeout: 3s
retries: 5
# ── TaskFlow App (development) ─────────────────────────────
app:
build:
context: .
dockerfile: Dockerfile
target: dev
container_name: taskflow-app
ports:
- "${PORT:-8080}:8080"
environment:
PORT: ${PORT:-8080}
DATABASE_URL: postgres://${PG_USER:-taskflow}:${PG_PASSWORD:-taskflow}@db:5432/${PG_DATABASE:-taskflow}?sslmode=disable
volumes:
- .:/app
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "--silent", "--fail", "http://localhost:8080/healthz"]
interval: 10s
timeout: 3s
retries: 3
start_period: 5s
restart: unless-stopped
volumes:
pgdata: