Comment on Zabbix in selfhosted env

mbirth@lemmy.ml ⁨3⁩ ⁨days⁩ ago

I have this running on a Raspberry Pi 5:

services:
  db:
    image: postgres:16-alpine
    environment:
      - POSTGRES_USER=zabbix
      - POSTGRES_PASSWORD=zabbix
      - PGDATA=/var/lib/postgresql/data
    volumes:
      - /opt/docker/zabbix7/pgdata/16/data:/var/lib/postgresql/data
    networks:
      - zabbix7
    restart: unless-stopped

  # fping needs setsuid
  # Connect to container as "root" and run: chmod +s /usr/sbin/fping
  server:
    image: zabbix/zabbix-server-pgsql:alpine-7.4-latest
    environment:
      - POSTGRES_USER=zabbix
      - POSTGRES_PASSWORD=zabbix
      - PHP_TZ=Europe/London
      - ZBX_SERVER_NAME=zabbix.domain.com
      - ZBX_NODEADDRESS=zabbix-server:10051
    cap_add:
      - NET_RAW
      - NET_ADMIN
    volumes:
      - /opt/docker/zabbix7/zabbix-server/alertscripts:/usr/lib/zabbix/alertscripts
      - /opt/docker/zabbix7/zabbix-server/externalscripts:/usr/lib/zabbix/externalscripts
      - /opt/docker/zabbix7/zabbix-server/mibs:/usr/lib/zabbix/mibs
      - /opt/docker/zabbix7/zabbix-server/modules:/usr/lib/zabbix/modules
      - /opt/docker/zabbix7/zabbix-server/export:/var/lib/zabbix/export
      - /opt/docker/zabbix7/zabbix-server/snmptraps:/var/lib/zabbix/snmptraps
    ports:
      - 10051:10051
    depends_on:
      - db
    links:
      - "db:postgres-server"
    networks:
      - zabbix7
      - traefik-public
    restart: unless-stopped

  web:
    image: zabbix/zabbix-web-nginx-pgsql:alpine-7.4-latest
    restart: unless-stopped
    environment:
        - PHP_TZ=Europe/London
        - ZBX_SERVER_NAME=zabbix.domain.com
        - ZBX_SERVER_HOST=zabbix-server
    #ports:
    #  - 10080:8080
    #  - 10081:443
    depends_on:
      - server
      - db
    links:
      - "server:zabbix-server"
      - "db:postgres-server"
    networks:
      - zabbix7
      - traefik-public
    labels:
      traefik.enable: "true"
      traefik.http.routers.zbx.rule: Host(`zabbix.domain.com`)
      traefik.http.routers.zbx.entrypoints: https
      traefik.http.routers.zbx.tls: "true"
      traefik.http.routers.zbx.tls.certresolver: le
      traefik.http.services.zbx.loadbalancer.server.port: "8080"

networks:
  traefik-public:
    external: true
  zabbix7:
    attachable: true

source
Sort:hotnewtop