# Real Zabbix 7.0 server for full integration testing.
#
#   docker compose -f tools/docker-compose.zabbix.yml up -d
#
# Web UI: http://localhost:8888  (default login Admin / zabbix)
# API:    http://localhost:8888/api_jsonrpc.php
#
# After it is up:
#   1. Log in, go to Users > API tokens, create a token, copy it.
#   2. Data collection > Hosts > Create host. Name the host by its IP
#      (e.g. 10.20.30.40) so host.get filter {host:[ip]} finds it, the same
#      way the production shop Zabbix names printer hosts.
#   3. Add items tagged component=supplies, type=level, color=<color> to
#      mirror the real printer templates (the mock server documents the shape).
#   4. Point the app at it:
#        ZABBIX_ENABLED=true
#        ZABBIX_URL=http://localhost:8888
#        ZABBIX_TOKEN=<token from step 1>
#      or set zabbix_enabled / zabbix_url / zabbix_token in the settings table.
#
# For API-contract testing only, prefer tools/mock_zabbix.py - it needs no
# image pulls and returns ready-made tagged supply items.

services:
  zabbix-postgres:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: zabbix
      POSTGRES_PASSWORD: zabbixpass
      POSTGRES_DB: zabbix
    volumes:
      - zabbix-pgdata:/var/lib/postgresql/data

  zabbix-server:
    image: zabbix/zabbix-server-pgsql:alpine-7.0-latest
    environment:
      DB_SERVER_HOST: zabbix-postgres
      POSTGRES_USER: zabbix
      POSTGRES_PASSWORD: zabbixpass
      POSTGRES_DB: zabbix
    depends_on:
      - zabbix-postgres
    ports:
      - "10051:10051"

  zabbix-web:
    image: zabbix/zabbix-web-nginx-pgsql:alpine-7.0-latest
    environment:
      DB_SERVER_HOST: zabbix-postgres
      POSTGRES_USER: zabbix
      POSTGRES_PASSWORD: zabbixpass
      POSTGRES_DB: zabbix
      ZBX_SERVER_HOST: zabbix-server
      PHP_TZ: America/New_York
    depends_on:
      - zabbix-server
    ports:
      - "8888:8080"

volumes:
  zabbix-pgdata:
