version: '3.8'

services:
  termix:
    image: ghcr.io/lukegus/termix:latest
    container_name: termix
    restart: unless-stopped
    ports:
      - "8180:8080"
    volumes:
      # Persistent data volume for database, SSH keys, settings
      - ./data:/app/data
    environment:
      # Port configuration (default is 8080)
      - PORT=8080

      # Optional: Set timezone
      - TZ=America/New_York

      # Optional: Custom app name
      # - APP_NAME=Manticorum SSH Manager

      # Optional: Database path (default is /app/data/termix.db)
      # - DATABASE_PATH=/app/data/termix.db

    # Optional: Resource limits
    # deploy:
    #   resources:
    #     limits:
    #       cpus: '1.5'
    #       memory: 1G
    #     reservations:
    #       cpus: '0.5'
    #       memory: 512M

    # Security options
    security_opt:
      - no-new-privileges:true

    # Network mode (bridge is default)
    network_mode: bridge

    # Health check
    healthcheck:
      test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s

# Optional: Define custom network
# networks:
#   termix-network:
#     driver: bridge

# Optional: Backup volume
# volumes:
#   termix-data:
#     driver: local
