add postgres examples

This commit is contained in:
2025-09-18 15:43:33 +08:00
parent 093d8efd3b
commit 5d5fa5e347
4 changed files with 283 additions and 0 deletions

19
docker/docker-compose.yml Normal file
View File

@@ -0,0 +1,19 @@
services:
postgres:
image: postgres:15
restart: unless-stopped
environment:
POSTGRES_DB: appdb
POSTGRES_USER: appuser
POSTGRES_PASSWORD: changeme
ports:
- "5432:5432"
volumes:
- pg_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 3s
timeout: 3s
retries: 5
volumes:
pg_data: