Files
container/oneuptime/master/docker-compose.yml
T

126 lines
4.3 KiB
YAML

version: '3.8'
services:
# 1. OneUptime Ingress: Das offizielle Nginx-Gateway (Liefert das Frontend aus)
oneuptime-ingress:
image: oneuptime/nginx:${ONEUPTIME_VERSION:-release}
container_name: oneuptime-ingress
restart: ${RESTART_POLICY:-always}
ports:
# Mappt deinen gewünschten Port 7080 auf den internen Nginx-Standardport
- "${HOST_PORT_HTTP:-7080}:8080"
- "${HOST_PORT_HTTPS:-4433}:4430"
environment:
- TZ=${TIMEZONE:-Europe/Berlin}
# Diese Variablen baut das Image zwingend in sein Nginx-Template ein
- NGINX_LISTEN_ADDRESS=${NGINX_LISTEN_ADDRESS:-0.0.0.0:}
- NGINX_LISTEN_OPTIONS=${NGINX_LISTEN_OPTIONS:-}
- SERVER_APP_HOSTNAME=app
- APP_PORT=3002
- SERVER_HOME_HOSTNAME=home
- HOME_PORT=1444
- HOST=${ONEUPTIME_HOST:-localhost:7080}
depends_on:
- app
# 2. OneUptime App-Core: Muss zwingend 'app' heißen, damit das Nginx-Image dorthin routet
app:
image: oneuptime/app:${ONEUPTIME_VERSION:-release}
container_name: oneuptime-master
restart: ${RESTART_POLICY:-always}
environment:
- CONTAINER_NAME=app
- PORT=3002
- ENCRYPTION_SECRET=${ENCRYPTION_SECRET:-ein_sehr_sicheres_zufaelliges_passwort_123!}
- APP_NAME=${APP_NAME:-OneUptime}
- TZ=${TIMEZONE:-Europe/Berlin}
# Internes URL-Routing
- HOST=${ONEUPTIME_HOST:-localhost:7080}
- HTTP_PROTOCOL=${ONEUPTIME_PROTOCOL:-http}
- SERVER_APP_HOSTNAME=app
- APP_PORT=3002
# PostgreSQL-Verbindungsmuster
- DATABASE_HOST=oneuptime-postgres
- DATABASE_PORT=5432
- DATABASE_NAME=${POSTGRES_DB:-oneuptimedb}
- DATABASE_USERNAME=${POSTGRES_USER:-oneuptime}
- DATABASE_PASSWORD=${POSTGRES_PASSWORD:-postgres_secure_pass_99!}
# Redis/Valkey-Verbindungsmuster
- REDIS_HOST=oneuptime-redis
- REDIS_PORT=6379
# ClickHouse-Verbindungsmuster
- CLICKHOUSE_HOST=oneuptime-clickhouse
- CLICKHOUSE_PORT=8123
- CLICKHOUSE_USER=default
- CLICKHOUSE_PASSWORD=clickhouse_lab_pass_99!
- CLICKHOUSE_DATABASE=oneuptime
volumes:
- ${ONEUPTIME_DATA_DIR:-/opt/docker/oneuptime/app}:/usr/src/app/data
depends_on:
oneuptime-postgres:
condition: service_healthy
- oneuptime-redis
- oneuptime-clickhouse
# 3. PostgreSQL: Relationale Konfigurationsdatenbank
oneuptime-postgres:
image: postgres:${POSTGRES_VERSION:-15-alpine}
container_name: oneuptime-postgres
restart: ${RESTART_POLICY:-always}
environment:
- POSTGRES_USER=${POSTGRES_USER:-oneuptime}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres_secure_pass_99!}
- POSTGRES_DB=${POSTGRES_DB:-oneuptimedb}
- TZ=${TIMEZONE:-Europe/Berlin}
volumes:
- ${POSTGRES_DATA_DIR:-/opt/docker/oneuptime/postgres}:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER:-oneuptime} -d $${POSTGRES_DB:-oneuptimedb}"]
interval: 5s
timeout: 5s
retries: 5
# 4. Redis: In-Memory-Datenbank für Caching & Queues
oneuptime-redis:
image: redis:${REDIS_VERSION:-7-alpine}
container_name: oneuptime-redis
restart: ${RESTART_POLICY:-always}
command: redis-server --appendonly yes
environment:
- TZ=${TIMEZONE:-Europe/Berlin}
volumes:
- ${REDIS_DATA_DIR:-/opt/docker/oneuptime/redis}:/data
# 5. ClickHouse: Analysedatenbank für Log-Daten und Metriken
oneuptime-clickhouse:
image: clickhouse/clickhouse-server:${CLICKHOUSE_VERSION:-latest}
container_name: oneuptime-clickhouse
restart: ${RESTART_POLICY:-always}
environment:
- TZ=${TIMEZONE:-Europe/Berlin}
- CLICKHOUSE_DB=oneuptime
- CLICKHOUSE_PASSWORD=clickhouse_lab_pass_99!
ulimits:
nofile:
soft: 262144
hard: 262144
volumes:
- ${CLICKHOUSE_DATA_DIR:-/opt/docker/oneuptime/clickhouse}:/var/lib/clickhouse
# 6. OneUptime Probe: Der integrierte Satellit für die Überprüfungen vor Ort
oneuptime-probe:
image: oneuptime/probe:${ONEUPTIME_VERSION:-release}
container_name: oneuptime-probe
restart: ${RESTART_POLICY:-always}
environment:
- TZ=${TIMEZONE:-Europe/Berlin}
- ONEUPTIME_URL=http://app:3002
- PROBE_ID=${PROBE_ID:-global-probe}
- PROBE_KEY=${PROBE_KEY:-default-probe-key-12345!}
depends_on:
- app