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

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

  zabbix-web-nginx-mysql:
    image: zabbix/zabbix-web-nginx-mysql:alpine-latest
    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}
      - MYSQL_ROOT_PASSWORD=${PANEL_DB_ROOT_PASSWORD}
    ports:
      - ${PANEL_APP_PORT_HTTP}:8080
    depends_on:
      - zabbix-server-mysql
    labels:
      createdBy: "Apps"
networks:
  1panel-network:
    external: true
