-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathdocker-compose-postgres.yml
More file actions
41 lines (39 loc) · 1.07 KB
/
docker-compose-postgres.yml
File metadata and controls
41 lines (39 loc) · 1.07 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
services:
server:
build: .
ports:
- 8000:8000
volumes:
- ./dailynotes-volume:/app/config
environment:
API_SECRET_KEY: ${API_SECRET_KEY:-CHANGE_THIS_WITH_SECURE_PASSWORD}
DB_ENCRYPTION_KEY: ${DB_ENCRYPTION_KEY:-CHANGE_THIS_WITH_SECURE_PASSWORD}
DATABASE_URI: postgresql://dailynotes:dailynotes@postgres:5432/dailynotes
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: dailynotes
POSTGRES_PASSWORD: dailynotes
POSTGRES_DB: dailynotes
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dailynotes -d dailynotes"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# Uncomment to expose PostgreSQL port for direct access
# ports:
# - 5432:5432
volumes:
postgres-data: