chore(dev): add PostgreSQL and Redis compose stack

This commit is contained in:
2026-08-04 12:00:58 +08:00
parent 3383a65867
commit b38f12e60b

39
compose.yaml Normal file
View File

@@ -0,0 +1,39 @@
name: tiku-dev
services:
postgres:
image: postgres:18-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ${TIKU_POSTGRES_DB:-tiku}
POSTGRES_USER: ${TIKU_POSTGRES_USER:-tiku}
POSTGRES_PASSWORD: ${TIKU_POSTGRES_PASSWORD:-tiku_dev}
ports:
- "127.0.0.1:${TIKU_POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
redis:
image: redis:7-alpine
restart: unless-stopped
command: ["redis-server", "--appendonly", "yes"]
ports:
- "127.0.0.1:${TIKU_REDIS_PORT:-6379}:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
start_period: 5s
volumes:
postgres_data:
redis_data: