Files
uptimesebi/compose.yaml

55 lines
1.4 KiB
YAML

name: uptimesebi
services:
timescaledb:
image: timescale/timescaledb:2.30.1-pg16
environment:
POSTGRES_PASSWORD: postgres
ports: ["5432:5432"]
volumes:
- pgdata:/var/lib/postgresql/data
- ./deploy/dev/postgres-init.sql:/docker-entrypoint-initdb.d/10-uptime.sql:ro
healthcheck:
test: ["CMD", "pg_isready", "-U", "uptime", "-d", "uptime"]
interval: 2s
retries: 30
redis:
image: redis:8-alpine
ports: ["6379:6379"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 2s
retries: 30
# Sentinel topology for HA testing: docker compose --profile sentinel up -d
# Host networking keeps announced addresses reachable from the host.
redis-primary:
image: redis:8-alpine
profiles: [sentinel]
network_mode: host
command: redis-server --port 6380
redis-replica:
image: redis:8-alpine
profiles: [sentinel]
network_mode: host
command: redis-server --port 6381 --replicaof 127.0.0.1 6380
sentinel-1: &sentinel
image: redis:8-alpine
profiles: [sentinel]
network_mode: host
entrypoint: ["sh", "-c", "cp /cfg/sentinel.conf /tmp/s.conf && exec redis-sentinel /tmp/s.conf --port $$PORT"]
environment: {PORT: "26379"}
volumes: [./deploy/dev/sentinel.conf:/cfg/sentinel.conf:ro]
sentinel-2:
<<: *sentinel
environment: {PORT: "26380"}
sentinel-3:
<<: *sentinel
environment: {PORT: "26381"}
volumes:
pgdata: