chore: prepare portable postgres development environment

This commit is contained in:
2026-09-18 17:30:42 +08:00
parent 0e8b8e1591
commit f2687c502a
4 changed files with 54 additions and 4 deletions

View File

@@ -1,15 +1,22 @@
services:
postgres:
image: postgres:16-alpine
container_name: personal-brand-postgres
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: personal_brand
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-personal_brand}
ports:
- "5432:5432"
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- personal-brand-postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 12
start_period: 5s
volumes:
personal-brand-postgres: