name: metric x-logging: &default-logging driver: json-file options: max-size: ${METRIC_LOG_MAX_SIZE:-25m} max-file: ${METRIC_LOG_MAX_FILES:-4} services: mongodb: image: mongo:8.0.12 restart: unless-stopped command: [ "mongod", "--bind_ip_all", "--wiredTigerCacheSizeGB", "${METRIC_MONGO_CACHE_GB:-2}", ] mem_limit: ${METRIC_MONGO_MEMORY_LIMIT:-3g} environment: MONGO_INITDB_ROOT_USERNAME: metric MONGO_INITDB_ROOT_PASSWORD: ${METRIC_MONGO_PASSWORD:?set in .env} volumes: - mongo-data:/data/db healthcheck: test: [ "CMD", "mongosh", "--quiet", "--username", "metric", "--password", "${METRIC_MONGO_PASSWORD}", "--authenticationDatabase", "admin", "--eval", "db.adminCommand('ping').ok", ] interval: 5s timeout: 3s retries: 30 logging: *default-logging ulimits: nofile: soft: 64000 hard: 64000 metric: image: ${METRIC_IMAGE:-ghcr.io/biosshot/metric:0.1.5} restart: unless-stopped mem_limit: ${METRIC_APP_MEMORY_LIMIT:-2g} depends_on: mongodb: condition: service_healthy symbolicator: condition: service_healthy required: false environment: MONGODB_URI: mongodb://metric:${METRIC_MONGO_PASSWORD}@mongodb:27017/?authSource=admin SCRUB_HMAC_KEY: ${METRIC_SCRUB_HMAC_KEY:?64 lowercase hex characters} METRIC_WEB_DIR: /opt/metric/web ports: - "${METRIC_HTTP_PORT:-4001}:4001" volumes: - ./metric.toml:/etc/metric/metric.toml:ro - blob-data:/var/lib/metric/blobs read_only: true tmpfs: - /tmp:size=64m,mode=1777 stop_grace_period: 40s security_opt: - no-new-privileges:true logging: *default-logging symbolicator: profiles: ["symbolication"] image: ${METRIC_SYMBOLICATOR_IMAGE:-ghcr.io/getsentry/symbolicator:26.6.0} restart: unless-stopped mem_limit: ${METRIC_SYMBOLICATOR_MEMORY_LIMIT:-2g} command: ["run", "-c", "/etc/symbolicator/config.yml"] volumes: - ./symbolicator.yml:/etc/symbolicator/config.yml:ro - symbolicator-cache:/data healthcheck: test: [ "CMD", "/bin/symbolicator", "healthcheck", "-c", "/etc/symbolicator/config.yml", ] interval: 10s timeout: 5s retries: 30 start_period: 20s security_opt: - no-new-privileges:true logging: *default-logging symbolicator-cleanup: profiles: ["symbolication"] image: ${METRIC_SYMBOLICATOR_IMAGE:-ghcr.io/getsentry/symbolicator:26.6.0} restart: unless-stopped mem_limit: ${METRIC_CLEANUP_MEMORY_LIMIT:-128m} command: [ "cleanup", "-c", "/etc/symbolicator/config.yml", "--repeat", "1h", ] volumes: - ./symbolicator.yml:/etc/symbolicator/config.yml:ro - symbolicator-cache:/data depends_on: symbolicator: condition: service_healthy security_opt: - no-new-privileges:true logging: *default-logging volumes: mongo-data: blob-data: symbolicator-cache: