# https://github.com/akmalovaa/zabbix-docker/blob/main/docker-compose.yml



services:

  zabbix-server:

    image: ${ZABBIX_SERVER_IMAGE:-zabbix/zabbix-server-pgsql:ubuntu-7.0-latest}

    container_name: server

    restart: unless-stopped

    ports:

      - "10051:10051"

    environment:

      DB_SERVER_HOST: postgres

      DB_SERVER_PORT: 5432

      POSTGRES_USER: ${POSTGRES_USER}

      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}

      POSTGRES_DB: ${POSTGRES_DB}

    depends_on:

      - postgres

    networks:

      - network-zabbix



  zabbix-frontend:

    image: ${ZABBIX_FRONTEND_IMAGE:-zabbix/zabbix-web-nginx-pgsql:ubuntu-7.0-latest}

    restart: unless-stopped

    container_name: frontend

    ports:

      - "8080:8080"

      - "8443:8443"

    environment:

      DB_SERVER_HOST: postgres

      POSTGRES_USER: ${POSTGRES_USER}

      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}

      POSTGRES_DB: ${POSTGRES_DB}

      PHP_TZ: ${TZ}

      ZBX_SERVER_HOST: zabbix-server

      ZBX_SERVER_PORT: 5432

    depends_on:

      - zabbix-server

    networks:

      - network-zabbix



#  zabbix-agent:

#    image:  ${ZABBIX_AGENT_IMAGE:-zabbix/zabbix-agent:ubuntu-7.0-latest}

#    container_name: agent

#    restart: unless-stopped

#    ports:

#      - "10050:10050"

#    environment:

#      ZBX_ACTIVE_ALLOW: false

#      TZ: ${TZ}

#      ZBX_SERVER_HOST: zabbix-server

#      ZBX_SERVER_PORT: 10051

#      ZBX_HOSTNAME: zabbix-agent

#      ZBX_HOSTNAMEITEM: system.hostname

#    depends_on:

#      - zabbix-server

#    networks:

#      - network-zabbix



  postgres:

    image: ${POSTGRES_IMAGE:-postgres:latest}

    container_name: postgres

    restart: unless-stopped

    ports:

      - "7432:5432"

      - "7433:5433"

    volumes:

      - postgres:/var/lib/postgresql/data

    environment:

      POSTGRES_USER: ${POSTGRES_USER}

      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}

      POSTGRES_DB: ${POSTGRES_DB}

      PG_DATA: /var/lib/postgresql/data/pgdata

    networks:

      - network-zabbix



#  grafana:

#    image: ${GRAFANA_IMAGE:-grafana/grafana}

#    container_name: grafana

#    restart: unless-stopped

#    ports:

#      - "3333:3333"

#    environment:

#      GF_SECURITY_ADMIN_USER: ${GRAFANA_USER:-admin}

#      GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_SECRET:-12345}

#      GF_INSTALL_PLUGINS: alexanderzobnin-zabbix-app

#      TZ: ${TZ}

#    user: "472"

#    volumes:

#      - grafana:/var/lib/grafana

#      - ./grafana/grafana.ini:/etc/grafana/grafana.ini

#      - ./grafana/provisioning:/etc/grafana/provisioning

#    depends_on:

#      - zabbix-frontend

#    networks:

#      - network-zabbix



volumes:

  postgres: {}

#  grafana: {}



networks:

  network-zabbix:

    driver: bridge

