services: ucm: image: neyslim/ultimate-ca-manager:latest container_name: ucm restart: unless-stopped ports: # UCM listens inside the container on UCM_HTTPS_PORT - "${UCM_HTTPS_PORT:-8443}:${UCM_HTTPS_PORT:-8443}" - "${UCM_HTTP_PORT:-8080}:8080" # Optional: DNS UPDATE (RFC 2136) listener of the ACME proxy. Internal # network only. Also enable the commented UCM_DNS_UPDATE_PORT below. # The container cannot bind port 53, so map the host port 53 to 8053. # - "53:8053/udp" # - "53:8053/tcp" volumes: # Persistent data volume (REQUIRED) - ucm-data:/opt/ucm/data # master.key, which decrypts every private key in the database (REQUIRED) - ucm-config:/etc/ucm # SoftHSM tokens live in the data volume since 2.233. This older volume is # read once, at the first start of 2.233, to carry its tokens over. - ucm-hsm-tokens:/var/lib/softhsm/tokens # Optional: Custom HTTPS certificates # - ./certs/https_cert.pem:/opt/ucm/data/https_cert.pem:ro # - ./certs/https_key.pem:/opt/ucm/data/https_key.pem:ro environment: # ======================================== # CORE SETTINGS (REQUIRED) # ======================================== # FQDN - CRITICAL for Docker (hostname detection doesn't work) - UCM_FQDN=${UCM_FQDN:-ucm.local} # Ports - UCM_HTTPS_PORT=${UCM_HTTPS_PORT:-8443} - UCM_HTTP_PORT=${UCM_HTTP_PORT:-8080} # DNS UPDATE listener (off when unset or 0). 1024..65535 only. # - UCM_DNS_UPDATE_PORT=8053 # - UCM_DNS_UPDATE_HOST=0.0.0.0 # address inside the container (default: HOST) # Debug & Logging - UCM_DEBUG=${UCM_DEBUG:-false} - UCM_LOG_LEVEL=${UCM_LOG_LEVEL:-INFO} # ======================================== # SECURITY (REQUIRED) # ======================================== # Unset: generated at the first start and kept in /etc/ucm/secret.key (the ucm-config volume) - UCM_SECRET_KEY=${UCM_SECRET_KEY:-} # Initial admin password (first start only). Unset: generated, read it with # docker compose exec ucm cat /opt/ucm/data/initial-admin-password # To choose it, prefer a secret (uncomment the secrets blocks too): # - UCM_INITIAL_ADMIN_PASSWORD_FILE=/run/secrets/ucm_admin_password # Second choice, visible in docker inspect: # - UCM_INITIAL_ADMIN_PASSWORD=change-me # ======================================== # DATABASE # ======================================== - UCM_DATABASE_PATH=${UCM_DATABASE_PATH:-/opt/ucm/data/ucm.db} - UCM_BACKUP_ENABLED=${UCM_BACKUP_ENABLED:-true} - UCM_BACKUP_RETENTION_DAYS=${UCM_BACKUP_RETENTION_DAYS:-30} - UCM_BACKUP_KEEP=${UCM_BACKUP_KEEP:-5} # SMTP, ACME, mTLS, session timeout and certificate defaults are set # in the web interface and stored in the database, not here. # ======================================== # CUSTOM HTTPS CERTIFICATES (OPTIONAL) # ======================================== # Paste PEM-encoded certificate/key here or mount as volumes - UCM_HTTPS_CERT=${UCM_HTTPS_CERT:-} - UCM_HTTPS_KEY=${UCM_HTTPS_KEY:-} # ======================================== # FIPS MODE (OPTIONAL) # ======================================== # Needs the -fips image (e.g. neyslim/ultimate-ca-manager:-fips); # the standard image refuses to start with it. With read_only: true, add # tmpfs for the module configuration and temporary files: # tmpfs: [/run/ucm:uid=1000, /tmp] # - UCM_FIPS=1 healthcheck: test: ["CMD", "curl", "-f", "-k", "https://localhost:${UCM_HTTPS_PORT:-8443}/api/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s # Security settings security_opt: - no-new-privileges:true cap_drop: - ALL cap_add: - CHOWN - SETGID - SETUID read_only: false # Needs to write to database # Resource limits (adjust based on your hardware) deploy: resources: limits: cpus: '2' memory: 2G reservations: cpus: '0.5' memory: 512M # secrets: # - ucm_admin_password networks: - ucm-network labels: - "com.ultimate-ca-manager.description=Certificate Authority Management" - "traefik.enable=false" # Disable if using Traefik networks: ucm-network: driver: bridge ipam: config: - subnet: 172.20.0.0/16 # secrets: # ucm_admin_password: # file: ./ucm_admin_password.txt # one line, the password; keep it out of version control volumes: ucm-data: driver: local ucm-config: driver: local ucm-hsm-tokens: driver: local