services:
  uuwaf:
    image: uusec/waf:7.1.1
    ulimits:
      nproc: 65535
      nofile:
        soft: 102400
        hard: 102400
    container_name:  ${CONTAINER_NAME}
    networks:
      - 1panel-network
    ports:
      - ${PANEL_APP_PORT_HTTP1}:80
      - ${PANEL_APP_PORT_HTTPS2}:443
      - ${PANEL_APP_PORT_HTTPS}:4443
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./waf_config:/uuwaf/web/conf
      - ./waf_acme:/uuwaf/acme
      - ./waf_logs:/uuwaf/logs
    environment:
      - UUWAF_MYSQL_PASSWORD=Safe3.WAF
      - UUWAF_RESOLVER=resolver 127.0.0.11 valid=30s ipv6=off;
    depends_on:
      wafdb:
        condition: service_healthy
  wafdb:
    image: mysql:5.7.44
    container_name:  ${CONTAINER_NAME}-db
    networks:
      - 1panel-network
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - ./waf_data:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=Safe3.WAF
    command: ["--max_connections=512"]
    healthcheck:
      test: ["CMD", "mysqladmin", "-uroot", "-pSafe3.WAF", "ping", "-h", "127.0.0.1", "--silent"]
      start_period: 3s
      interval: 5s
      timeout: 3s
      retries: 10

networks:
  1panel-network:
    external: true
