services:
  uuwaf:
     build: ./docker/
     ulimits:
       nproc: 65535
       nofile:
         soft: 102400
         hard: 102400
     container_name: ${CONTAINER_NAME}-uuwaf
     networks:
       1panel-network:
       wafnet:
         ipv4_address: ${SUBNET_PREFIX}.3
     ports:
       - "${PANEL_APP_PORT_HTTP}:80"
       - "${PANEL_APP_PORT_HTTPS}:443"
       - "${PANEL_APP_PORT_CONSOLE}:4443"
     volumes:
       - ./uuwaf:/uuwaf
     command: ["/run.sh"]
     environment:
       - TZ=${TIME_ZONE}
     labels:  
       createdBy: "Apps"
     links:
     - wafdb
     depends_on:
        - wafdb

  wafdb:
    image: percona:8
    container_name: ${CONTAINER_NAME}-wafdb
    networks:
      1panel-network:
      wafnet:
        ipv4_address: ${SUBNET_PREFIX}.7
    #ports:
    #- "127.0.0.1:4306:3306"
    volumes:
      - ./uuwaf/initdb:/docker-entrypoint-initdb.d
      - wafdata:/var/lib/mysql
    environment:
      - TZ=${TIME_ZONE}
      - INIT_ROCKSDB
      - MYSQL_ROOT_PASSWORD=Safe3.WAF
    labels:  
      createdBy: "Apps"

volumes:
  wafdata:

networks:
  1panel-network:
    external: true
  wafnet:
    name: wafnet
    driver: bridge
    ipam:
      driver: default
      config:
      - gateway: ${SUBNET_PREFIX:?SUBNET_PREFIX required}.1
        subnet: ${SUBNET_PREFIX}.0/24
