Files
uptimesebi/compose.yaml
Sebastian UnterschützandClaude Opus 5.5 d3cf9f48e1
ci / image (pull_request) Successful in 2m38s
ci / build (pull_request) Successful in 7m5s
ci / lint (pull_request) Successful in 10m15s
ci / test (pull_request) Failing after 11m53s
feat: database monitors with sealed credentials
Secret monitor settings such as database passwords are stored sealed,
bound to monitor type and field, never returned by the API, the console
or exports, kept when an edit leaves them empty, and opened only for the
checker's job. Monitor types are validated by the check package; the
database only checks their format. Compose gets a checks profile with
MariaDB, MongoDB and SQL Server, and CI tests against MariaDB and
MongoDB.

Closes #93

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
2026-11-22 16:17:08 +01:00

87 lines
2.5 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"}
# Databases the database checks are tested against:
# docker compose --profile checks up -d --wait
mariadb:
image: mariadb:11
profiles: [checks]
environment: {MARIADB_ROOT_PASSWORD: checkpw, MARIADB_DATABASE: shop}
ports: ["13306:3306"]
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect"]
interval: 2s
retries: 60
mongo:
image: mongo:8
profiles: [checks]
environment: {MONGO_INITDB_ROOT_USERNAME: root, MONGO_INITDB_ROOT_PASSWORD: checkpw}
ports: ["27018:27017"]
healthcheck:
test: ["CMD", "mongosh", "--quiet", "--eval", "db.runCommand({ping: 1})"]
interval: 2s
retries: 60
mssql:
image: mcr.microsoft.com/mssql/server:2022-latest
profiles: [checks]
environment: {ACCEPT_EULA: "Y", MSSQL_SA_PASSWORD: "Check-pw-2026"}
ports: ["11433:1433"]
healthcheck:
test: ["CMD-SHELL", "/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P \"$$MSSQL_SA_PASSWORD\" -Q 'SELECT 1' || exit 1"]
interval: 3s
retries: 60
volumes:
pgdata: