From 6708993fb2725a2a672d6b031512b235210a4d14 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Fri, 20 Sep 2024 01:25:39 +0900 Subject: [PATCH] Using long syntax to expose ports --- compose_zabbix_components.yaml | 74 +++++++++++++++++++++++++++------- 1 file changed, 60 insertions(+), 14 deletions(-) diff --git a/compose_zabbix_components.yaml b/compose_zabbix_components.yaml index 704c57fb0..ece0cb2ed 100644 --- a/compose_zabbix_components.yaml +++ b/compose_zabbix_components.yaml @@ -2,7 +2,11 @@ services: server: init: true ports: - - "${ZABBIX_SERVER_PORT}:10051" + - name: zabbix-trapper + target: 10051 + published: "${ZABBIX_SERVER_PORT}" + protocol: tcp + app_protocol: zabbix-trapper restart: "${RESTART_POLICY}" attach: true volumes: @@ -15,7 +19,7 @@ services: - ${DATA_DIRECTORY}/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro - ${DATA_DIRECTORY}/var/lib/zabbix/ssh_keys:/var/lib/zabbix/ssh_keys:ro - ${DATA_DIRECTORY}/var/lib/zabbix/mibs:/var/lib/zabbix/mibs:ro - - snmptraps:/var/lib/zabbix/snmptraps:ro + - snmptraps:/var/lib/zabbix/snmptraps:roz tmpfs: /tmp ulimits: nproc: 65535 @@ -150,7 +154,11 @@ services: extends: service: proxy ports: - - "${ZABBIX_PROXY_SQLITE3_PORT}:10051" + - name: zabbix-trapper + target: 10051 + published: "${ZABBIX_PROXY_SQLITE3_PORT}" + protocol: tcp + app_protocol: zabbix-trapper env_file: - ${ENV_VARS_DIRECTORY}/.env_prx_sqlite3 - path: ${ENV_VARS_DIRECTORY}/.env_prx_sqlite3_override @@ -167,7 +175,11 @@ services: extends: service: proxy ports: - - "${ZABBIX_PROXY_MYSQL_PORT}:10051" + - name: zabbix-trapper + target: 10051 + published: "${ZABBIX_PROXY_MYSQL_PORT}" + protocol: tcp + app_protocol: zabbix-trapper # volumes: # - dbsocket:/var/run/mysqld/ env_file: @@ -196,8 +208,16 @@ services: profiles: - all ports: - - "${ZABBIX_WEB_APACHE_HTTP_PORT}:8080" - - "${ZABBIX_WEB_APACHE_HTTPS_PORT}:8443" + - name: web-http + target: 8080 + published: "${ZABBIX_WEB_APACHE_HTTP_PORT}" + protocol: tcp + app_protocol: http + - name: web-https + target: 8443 + published: "${ZABBIX_WEB_APACHE_HTTPS_PORT}" + protocol: tcp + app_protocol: https restart: "${RESTART_POLICY}" attach: false volumes: @@ -274,8 +294,16 @@ services: web-nginx: ports: - - "${ZABBIX_WEB_NGINX_HTTP_PORT}:8080" - - "${ZABBIX_WEB_NGINX_HTTPS_PORT}:8443" + - name: web-http + target: 8080 + published: "${ZABBIX_WEB_NGINX_HTTP_PORT}" + protocol: tcp + app_protocol: http + - name: web-https + target: 8443 + published: "${ZABBIX_WEB_NGINX_HTTPS_PORT}" + protocol: tcp + app_protocol: https restart: "${RESTART_POLICY}" attach: false volumes: @@ -360,7 +388,11 @@ services: - full - all ports: - - "${ZABBIX_AGENT_PORT}:10050" + - name: zabbix-agent + target: 10050 + published: "${ZABBIX_AGENT_PORT}" + protocol: tcp + app_protocol: zabbix-agent restart: "${RESTART_POLICY}" attach: false volumes: @@ -402,7 +434,11 @@ services: - full - all ports: - - "${ZABBIX_AGENT2_PORT}:10050" + - name: zabbix-agent + target: 10050 + published: "${ZABBIX_AGENT2_PORT}" + protocol: tcp + app_protocol: zabbix-agent restart: "${RESTART_POLICY}" attach: false volumes: @@ -443,7 +479,10 @@ services: - full - all ports: - - "${ZABBIX_JAVA_GATEWAY_PORT}:10052" + - name: zabbix-java-gw + target: 10052 + published: "${ZABBIX_JAVA_GATEWAY_PORT}" + protocol: tcp restart: "${RESTART_POLICY}" attach: false deploy: @@ -477,12 +516,16 @@ services: - full - all ports: - - "${ZABBIX_SNMPTRAPS_PORT}:1162/udp" + - name: snmptrap + target: 1162 + published: "${ZABBIX_SNMPTRAPS_PORT}" + protocol: udp + app_protocol: snmptrap restart: "${RESTART_POLICY}" attach: false read_only: true volumes: - - snmptraps:/var/lib/zabbix/snmptraps:rw + - snmptraps:/var/lib/zabbix/snmptraps:rwz tmpfs: /tmp deploy: resources: @@ -512,7 +555,10 @@ services: - full - all ports: - - "${ZABBIX_WEB_SERVICE_PORT}:10053" + - name: zabbix-web-service + target: 10053 + published: "${ZABBIX_WEB_SERVICE_PORT}" + protocol: tcp restart: "${RESTART_POLICY}" attach: false volumes: