services:
  unifi-network-application:
    image: lscr.io/linuxserver/unifi-network-application:latest
    container_name: unifi-network-application
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - MONGO_USER=unifi
      - MONGO_PASS=pass
      - MONGO_HOST=unifi-db
      - MONGO_PORT=27017
      - MONGO_DBNAME=unifi
      - MONGO_AUTHSOURCE=admin
#      - MEM_LIMIT=1024 #optional
#      - MEM_STARTUP=1024 #optional
#      - MONGO_TLS= #optional
#    volumes:
#      - /path/to/unifi-network-application/data:/config
    ports:
      - 8444:8443
      - 3478:3478/udp
      - 10001:10001/udp
      - 8181:8080
#      - 1900:1900/udp #optional
#      - 8843:8843 #optional
#      - 8880:8880 #optional
#      - 6789:6789 #optional
#      - 5514:5514/udp #optional
    restart: unless-stopped

  unifi-db:
    image: docker.io/mongo:latest
    container_name: unifi-db
    environment:
      - MONGO_INITDB_ROOT_USERNAME=root
      - MONGO_INITDB_ROOT_PASSWORD=pass
      - MONGO_USER=unifi
      - MONGO_PASS=pass
      - MONGO_DBNAME=unifi
      - MONGO_AUTHSOURCE=admin
#    volumes:
#      - /path/to/data:/data/db
#      - /path/to/init-mongo.sh:/docker-entrypoint-initdb.d/init-mongo.sh:ro
    restart: unless-stopped
