---
version: "2.1"
services:
  unifi-controller:
    image: lscr.io/linuxserver/unifi-controller
    container_name: unifi-controller
    environment:
      - PUID=1001
      - PGID=1002
      - MEM_LIMIT=1024M #optional
      - MEM_STARTUP=1024M #optional
    volumes:
      - ./data:/config
    ports:
      - 3478:3478/udp
      - 10001:10001/udp
      - 8080:8080
      - 8443:8443
      # - 1900:1900/udp #optional
      # - 8843:8843 #optional
      # - 8880:8880 #optional
      # - 6789:6789 #optional
      # - 5514:5514/udp #optional
    restart: unless-stopped
---
version: "2.1"
services:
  unifi-controller:
    image: lscr.io/linuxserver/unifi-controller
    container_name: unifi-controller
    environment:
      - PUID=1001 #change to UID of service user 
      - PGID=1002 #change to GID of service user
      - MEM_LIMIT=1024M #optional
      - MEM_STARTUP=1024M #optional
    volumes:
      - ./data:/config
    ports:
      - 3478:3478/udp
      - 10001:10001/udp
      - 8080:8080
      - 8443:8443
      # - 1900:1900/udp #optional
      # - 8843:8843 #optional
      # - 8880:8880 #optional
      # - 6789:6789 #optional
      # - 5514:5514/udp #optional
    restart: unless-stopped

Add comment for pid and gid
Add comment for pid and gid
