# UniFi Network Application
# Data: /volume1/docker/unifi
# Live controller ook op https://192.168.1.24 (apart apparaat/VM)

services:
  unifi:
    image: lscr.io/linuxserver/unifi-network-application:latest
    container_name: unifi
    restart: unless-stopped
    network_mode: host
    environment:
      PUID: ${PUID:-1026}
      PGID: ${PGID:-100}
      TZ: ${TZ:-Europe/Brussels}
      MONGO_HOST: unifi-db
      MONGO_PORT: 27017
      MONGO_USER: ${MONGO_USER:-unifi}
      MONGO_PASS: ${MONGO_PASS:-WaQTUw2t}
      MONGO_DBNAME: ${MONGO_DBNAME:-unifi}
      MONGO_AUTHSOURCE: admin
      MEM_LIMIT: 1024
      MEM_STARTUP: 1024
    volumes:
      - ${UNIFI_DATA_DIR:-/volume1/docker/unifi}:/config
    depends_on:
      - unifi-db

  unifi-db:
    image: docker.io/mongo:4.4
    container_name: unifi-db
    restart: unless-stopped
    environment:
      MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER:-unifi}
      MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASS:-WaQTUw2t}
    volumes:
      - ${UNIFI_MONGO_DIR:-/volume1/docker/Configs/Unifi/data/db}:/data/db
