TCPDashboard/docker-compose.yml

50 lines
1.3 KiB
YAML
Raw Permalink Normal View History

2025-05-29 23:50:41 +08:00
services:
postgres:
image: timescale/timescaledb:latest-pg15
2025-05-29 23:50:41 +08:00
container_name: dashboard_postgres
command: ["postgres", "-c", "shared_preload_libraries=timescaledb"]
2025-05-29 23:50:41 +08:00
environment:
POSTGRES_DB: ${POSTGRES_DB:-dashboard}
POSTGRES_USER: ${POSTGRES_USER:-dashboard}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
2025-05-29 23:50:41 +08:00
POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C"
ports:
2025-05-30 17:27:32 +08:00
- "${POSTGRES_PORT:-5434}:5432"
2025-05-29 23:50:41 +08:00
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/init:/docker-entrypoint-initdb.d
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-dashboard}"]
interval: 30s
timeout: 10s
retries: 3
networks:
- dashboard-network
redis:
image: redis:7-alpine
container_name: dashboard_redis
command: redis-server --appendonly yes --appendfsync everysec --requirepass ${REDIS_PASSWORD}
2025-05-29 23:50:41 +08:00
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- redis_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping"]
2025-05-29 23:50:41 +08:00
interval: 30s
timeout: 10s
retries: 3
networks:
- dashboard-network
volumes:
postgres_data:
driver: local
redis_data:
driver: local
networks:
dashboard-network:
driver: bridge