Files
Aether/deploy/docker-compose.data.yml
T

47 lines
1.2 KiB
YAML
Raw Normal View History

services:
postgres:
image: ${POSTGRES_IMAGE:-postgres:15}
container_name: aether-postgres
environment:
POSTGRES_DB: ${DB_NAME:-aether}
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD}
TZ: ${TZ:-Asia/Shanghai}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "127.0.0.1:${DB_PORT:-5432}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres} -d ${DB_NAME:-aether}"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
redis:
image: ${REDIS_IMAGE:-redis:7-alpine}
container_name: aether-redis
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD}
TZ: ${TZ:-Asia/Shanghai}
volumes:
- redis_data:/data
command: >
sh -c 'exec redis-server
--appendonly yes
--appendfsync everysec
--save 60 1000
--requirepass "$$REDIS_PASSWORD"'
ports:
- "127.0.0.1:${REDIS_PORT:-6379}:6379"
healthcheck:
test: ["CMD-SHELL", "redis-cli -a \"$$REDIS_PASSWORD\" ping | grep -q PONG"]
interval: 5s
timeout: 3s
retries: 5
restart: unless-stopped
volumes:
postgres_data:
redis_data: