services:
  zabbix-server-mysql:
    container_name: ${CONTAINER_NAME}
    restart: always
    networks:
      - 1panel-network
    ports:
      - "${PANEL_APP_PORT_HTTP2}:10051"
    environment:
      - DB_SERVER_HOST=${PANEL_DB_HOST}
      - DB_SERVER_PORT=${ZABBIX_DB_PORT}
      - MYSQL_DATABASE=${PANEL_DB_NAME}
      - MYSQL_USER=${PANEL_DB_USER}
      - MYSQL_PASSWORD=${PANEL_DB_USER_PASSWORD}
      - ZBX_JAVAGATEWAY=zabbix-java-gateway
    image: zabbix/zabbix-server-mysql:7.4.7-alpine
    depends_on:
      - zabbix-java-gateway
    labels:
      createdBy: Apps

  zabbix-java-gateway:
    container_name: ${CONTAINER_NAME}-gateway
    restart: always
    networks:
      - 1panel-network
    image: zabbix/zabbix-java-gateway:7.4.7-alpine
    labels:
      createdBy: Apps

  zabbix-web-nginx-mysql:
    container_name: ${CONTAINER_NAME}-nginx
    restart: always
    networks:
      - 1panel-network
    environment:
      - ZBX_SERVER_HOST=zabbix-server-mysql
      - DB_SERVER_HOST=${PANEL_DB_HOST}
      - MYSQL_DATABASE=${PANEL_DB_NAME}
      - MYSQL_USER=${PANEL_DB_USER}
      - MYSQL_PASSWORD=${PANEL_DB_USER_PASSWORD}
    ports:
      - ${PANEL_APP_PORT_HTTP}:8080
    image: zabbix/zabbix-web-nginx-mysql:7.4.7-alpine
    depends_on:
      - zabbix-server-mysql
    labels:
      createdBy: Apps
networks:
  1panel-network:
    external: true
