Using long syntax to expose ports

This commit is contained in:
Alexey Pustovalov 2024-09-20 01:25:39 +09:00
parent 87fb470db0
commit 7da1ef4c76

View File

@ -2,7 +2,11 @@ services:
server: server:
init: true init: true
ports: ports:
- "${ZABBIX_SERVER_PORT}:10051" - name: zabbix-trapper
target: 10051
published: "${ZABBIX_SERVER_PORT}"
protocol: tcp
app_protocol: zabbix-trapper
restart: "${RESTART_POLICY}" restart: "${RESTART_POLICY}"
attach: true attach: true
volumes: volumes:
@ -15,7 +19,7 @@ services:
- ${DATA_DIRECTORY}/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro - ${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/ssh_keys:/var/lib/zabbix/ssh_keys:ro
- ${DATA_DIRECTORY}/var/lib/zabbix/mibs:/var/lib/zabbix/mibs: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 tmpfs: /tmp
ulimits: ulimits:
nproc: 65535 nproc: 65535
@ -150,7 +154,11 @@ services:
extends: extends:
service: proxy service: proxy
ports: 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_file:
- ${ENV_VARS_DIRECTORY}/.env_prx_sqlite3 - ${ENV_VARS_DIRECTORY}/.env_prx_sqlite3
- path: ${ENV_VARS_DIRECTORY}/.env_prx_sqlite3_override - path: ${ENV_VARS_DIRECTORY}/.env_prx_sqlite3_override
@ -167,7 +175,11 @@ services:
extends: extends:
service: proxy service: proxy
ports: ports:
- "${ZABBIX_PROXY_MYSQL_PORT}:10051" - name: zabbix-trapper
target: 10051
published: "${ZABBIX_PROXY_MYSQL_PORT}"
protocol: tcp
app_protocol: zabbix-trapper
# volumes: # volumes:
# - dbsocket:/var/run/mysqld/ # - dbsocket:/var/run/mysqld/
env_file: env_file:
@ -196,8 +208,16 @@ services:
profiles: profiles:
- all - all
ports: ports:
- "${ZABBIX_WEB_APACHE_HTTP_PORT}:8080" - name: web-http
- "${ZABBIX_WEB_APACHE_HTTPS_PORT}:8443" 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}" restart: "${RESTART_POLICY}"
attach: false attach: false
volumes: volumes:
@ -274,8 +294,16 @@ services:
web-nginx: web-nginx:
ports: ports:
- "${ZABBIX_WEB_NGINX_HTTP_PORT}:8080" - name: web-http
- "${ZABBIX_WEB_NGINX_HTTPS_PORT}:8443" 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}" restart: "${RESTART_POLICY}"
attach: false attach: false
volumes: volumes:
@ -360,7 +388,11 @@ services:
- full - full
- all - all
ports: ports:
- "${ZABBIX_AGENT_PORT}:10050" - name: zabbix-agent
target: 10050
published: "${ZABBIX_AGENT_PORT}"
protocol: tcp
app_protocol: zabbix-agent
restart: "${RESTART_POLICY}" restart: "${RESTART_POLICY}"
attach: false attach: false
volumes: volumes:
@ -402,7 +434,11 @@ services:
- full - full
- all - all
ports: ports:
- "${ZABBIX_AGENT2_PORT}:10050" - name: zabbix-agent
target: 10050
published: "${ZABBIX_AGENT2_PORT}"
protocol: tcp
app_protocol: zabbix-agent
restart: "${RESTART_POLICY}" restart: "${RESTART_POLICY}"
attach: false attach: false
volumes: volumes:
@ -443,7 +479,10 @@ services:
- full - full
- all - all
ports: ports:
- "${ZABBIX_JAVA_GATEWAY_PORT}:10052" - name: zabbix-java-gw
target: 10052
published: "${ZABBIX_JAVA_GATEWAY_PORT}"
protocol: tcp
restart: "${RESTART_POLICY}" restart: "${RESTART_POLICY}"
attach: false attach: false
deploy: deploy:
@ -477,12 +516,16 @@ services:
- full - full
- all - all
ports: ports:
- "${ZABBIX_SNMPTRAPS_PORT}:1162/udp" - name: snmptrap
target: 1162
published: "${ZABBIX_SNMPTRAPS_PORT}"
protocol: udp
app_protocol: snmptrap
restart: "${RESTART_POLICY}" restart: "${RESTART_POLICY}"
attach: false attach: false
read_only: true read_only: true
volumes: volumes:
- snmptraps:/var/lib/zabbix/snmptraps:rw - snmptraps:/var/lib/zabbix/snmptraps:rwz
tmpfs: /tmp tmpfs: /tmp
deploy: deploy:
resources: resources:
@ -512,7 +555,10 @@ services:
- full - full
- all - all
ports: ports:
- "${ZABBIX_WEB_SERVICE_PORT}:10053" - name: zabbix-web-service
target: 10053
published: "${ZABBIX_WEB_SERVICE_PORT}"
protocol: tcp
restart: "${RESTART_POLICY}" restart: "${RESTART_POLICY}"
attach: false attach: false
volumes: volumes: