version: '3.5' services: timescaledb: image: timescale/timescaledb:1.6.0-pg11 container_name: timescaledb restart: always network_mode: "host" volumes: - /etc/localtime:/etc/localtime:ro - /data/zabbix/postgresql/data:/var/lib/postgresql/data:rw user: root stop_grace_period: 1m environment: - POSTGRES_USER=zabbix - POSTGRES_PASSWORD=abc123 - TS_TUNE_MEMORY=7GB - TS_TUNE_NUM_CPUS=7 logging: driver: "json-file" options: max-size: "128M" zabbix-server: image: zabbix/zabbix-server-pgsql:alpine-4.4.7 container_name: zabbix-server-pgsql restart: always network_mode: "host" depends_on: - timescaledb ports: - "10051:10051" volumes: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro - /data/zabbix/zbx_env/usr/lib/zabbix/alertscripts:/usr/lib/zabbix/alertscripts:ro - /data/zabbix/zbx_env/usr/lib/zabbix/externalscripts:/usr/lib/zabbix/externalscripts:ro - /data/zabbix/zbx_env/var/lib/zabbix/modules:/var/lib/zabbix/modules:ro - /data/zabbix/zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro - /data/zabbix/zbx_env/var/lib/zabbix/ssh_keys:/var/lib/zabbix/ssh_keys:ro - /data/zabbix/zbx_env/var/lib/zabbix/mibs:/var/lib/zabbix/mibs:ro - /data/zabbix/zbx_env/var/lib/zabbix/snmptraps:/var/lib/zabbix/snmptraps:ro environment: - ENABLE_TIMESCALEDB=true - DB_SERVER_HOST=127.0.0.1 - POSTGRES_DB=zabbix - POSTGRES_USER=zabbix - POSTGRES_PASSWORD=abc123 - DebugLevel=3 - HistoryStorageDateIndex=1 - ZBX_CACHESIZE=1024M - ZBX_CACHEUPDATEFREQUENCY=60 - ZBX_STARTDBSYNCERS=4 - ZBX_HISTORYCACHESIZE=1024M - ZBX_HISTORYINDEXCACHESIZE=512M - ZBX_TRENDCACHESIZE=2046M - ZBX_VALUECACHESIZE=2048M - ZBX_TRAPPERTIMEOUT=30 - ZBX_UNREACHABLEPERIOD=120 - ZBX_UNAVAILABLEDELAY=80 - ZBX_STARTTRAPPERS=7 - ZBX_STARTPOLLERS=7 - ZBX_STARTPOLLERSUNREACHABLE=7 - ZBX_STARTPINGERS=7 - ZBX_STARTDISCOVERERS=7 - ZBX_STARTHTTPPOLLERS=1 - ZBX_HOUSEKEEPINGFREQUENCY=1 - ZBX_MAXHOUSEKEEPERDELETE=100000 ulimits: nproc: 65535 nofile: soft: 20000 hard: 40000 deploy: resources: limits: cpus: '0.70' memory: 1G reservations: cpus: '0.5' memory: 512M user: root sysctls: - net.ipv4.ip_local_port_range=1024 65000 - net.ipv4.conf.all.accept_redirects=0 - net.ipv4.conf.all.secure_redirects=0 - net.ipv4.conf.all.send_redirects=0 - net.ipv4.tcp_fin_timeout=30 - net.ipv4.tcp_keepalive_time=1800 - net.ipv4.tcp_tw_reuse=1 - net.core.somaxconn=65535 logging: driver: "json-file" options: max-size: "128M" zabbix-web-nginx-pgsql: image: zabbix/zabbix-web-nginx-pgsql:alpine-4.4.7 container_name: zabbix-web-nginx-pgsql restart: always network_mode: "host" ports: - "8081:80" - "8443:443" environment: - ENABLE_TIMESCALEDB=true - DB_SERVER_HOST=127.0.0.1 - POSTGRES_DB=zabbix - POSTGRES_USER=zabbix - POSTGRES_PASSWORD=abc123 - ZBX_SERVER_HOST=127.0.0.1 - PHP_TZ="Asia/Shanghai" volumes: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro - /data/zabbix/zbx_env/etc/ssl/nginx:/etc/ssl/nginx:ro - /data/zabbix/graphfont.ttf:/usr/share/zabbix/assets/fonts/DejaVuSans.ttf deploy: resources: limits: cpus: '0.70' memory: 512M reservations: cpus: '0.5' memory: 256M user: root depends_on: - timescaledb - zabbix-server healthcheck: test: ["CMD", "curl", "-f", "http://localhost"] interval: 10s timeout: 5s retries: 3 start_period: 30s sysctls: - net.core.somaxconn=65535 logging: driver: "json-file" options: max-size: "128M"