-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
64 lines (61 loc) · 1.59 KB
/
docker-compose.yml
File metadata and controls
64 lines (61 loc) · 1.59 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
services:
app:
build: .
ports:
- "3001:3001"
environment:
- NODE_ENV=production
- PORT=3001
- POSTGRES_HOST=db
- POSTGRES_PORT=5432
- POSTGRES_DB=notes_world
- POSTGRES_USER=notes_world
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- PHASE1_USER_ID=${PHASE1_USER_ID:-00000000-0000-0000-0000-000000000001}
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3001/health || exit 1"]
interval: 15s
timeout: 5s
retries: 5
start_period: 30s
depends_on:
db:
condition: service_healthy
restart: unless-stopped
db:
image: postgres:16-alpine
environment:
- POSTGRES_DB=notes_world
- POSTGRES_USER=notes_world
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U notes_world"]
interval: 5s
timeout: 5s
retries: 10
restart: unless-stopped
db-backup:
image: prodrigestivill/postgres-backup-local:16-alpine
environment:
- POSTGRES_HOST=db
- POSTGRES_PORT=5432
- POSTGRES_DB=notes_world
- POSTGRES_USER=notes_world
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_EXTRA_OPTS=--clean --if-exists
- SCHEDULE=@daily
- BACKUP_KEEP_DAYS=7
- BACKUP_KEEP_WEEKS=4
- BACKUP_KEEP_MONTHS=3
- HEALTHCHECK_PORT=8080
- TZ=${TZ:-UTC}
volumes:
- ./backups:/backups
depends_on:
db:
condition: service_healthy
restart: unless-stopped
volumes:
postgres_data: