--- name: unifi-network-application networks: unifi-network-application_net: attachable: false internal: false external: false name: unifi-network-application driver: bridge ipam: driver: default config: - subnet: 172.20.19.0/24 ip_range: 172.20.19.0/24 gateway: 172.20.19.1 driver_opts: com.docker.network.bridge.default_bridge: "false" com.docker.network.bridge.enable_icc: "true" com.docker.network.bridge.enable_ip_masquerade: "true" com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" com.docker.network.bridge.name: "unifi" com.docker.network.driver.mtu: "1500" labels: com.unifi-network-application.network.description: "is an isolated bridge network." services: unifi-network-application_db: deploy: resources: limits: pids: 2048 # Limits the number of processes and threads (fork bomb protection). restart: unless-stopped logging: driver: "json-file" options: max-size: "1M" max-file: "2" stop_grace_period: 1m container_name: unifi-network-application_db image: docker.io/mongo:9.0.8@sha256:f3ab7aaf2a3e69494655e418eb450569a0bb6a1a913c3dc624245a0000bfaf4b pull_policy: if_not_present volumes: - /docker/unifi-network-application/production/db:/data/db - /docker/unifi-network-application/init-mongo.sh:/docker-entrypoint-initdb.d/init-mongo.sh:ro env_file: # Compose loads each file that exists and skips a missing one: # '.env' for the Docker Compose CLI, 'stack.env' for Portainer. - path: .env required: false - path: stack.env required: false environment: PUID: "1000" PGID: "1000" TZ: Europe/Amsterdam # Adjust the timezone to match your local timezone. You can find the full list of timezones here https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. MONGO_AUTHSOURCE: ${ROOT_AUTHSOURCE_DB} # Fill in the value in both the .env and stack.env files MONGO_INITDB_ROOT_PASSWORD: ${ROOT_PASSWORD_DB} # Fill in the value in both the .env and stack.env files MONGO_INITDB_ROOT_USERNAME: ${ROOT_USER_DB} # Fill in the value in both the .env and stack.env files MONGO_DBNAME: ${NAME_DB} # Fill in the value in both the .env and stack.env files MONGO_PASS: ${PASSWORD_DB} # Fill in the value in both the .env and stack.env files MONGO_USER: ${USER_DB} # Fill in the value in both the .env and stack.env files hostname: unifi-network-application_db networks: unifi-network-application_net: ipv4_address: 172.20.19.2 security_opt: - no-new-privileges:true labels: com.unifi-network-application.db.description: "is an Mongo database." healthcheck: disable: false test: [ "CMD", "mongosh", "mongodb://${USER_DB}:${PASSWORD_DB}@${HOST_DB}:${PORT_DB}/?authSource=${ROOT_AUTHSOURCE_DB}", "--quiet", "--eval", "printjson(db.runCommand('ping').ok)", ] interval: 10s timeout: 5s retries: 3 start_period: 10s start_interval: 5s unifi-network-application_app: deploy: resources: limits: pids: 2048 # Limits the number of processes and threads (fork bomb protection). restart: unless-stopped logging: driver: "json-file" options: max-size: "1M" max-file: "2" stop_grace_period: 1m container_name: unifi-network-application image: ghcr.io/linuxserver/unifi-network-application:10.6.109@sha256:f513921ea25fc33a2a56f28a8d2111aeeba3dac1ab5e4eb72827b8d81351c988 pull_policy: if_not_present depends_on: unifi-network-application_db: condition: service_healthy volumes: - /docker/unifi-network-application/production/app:/config env_file: # Compose loads each file that exists and skips a missing one: # '.env' for the Docker Compose CLI, 'stack.env' for Portainer. - path: .env required: false - path: stack.env required: false environment: PUID: "1000" PGID: "1000" TZ: Europe/Amsterdam # Adjust the timezone to match your local timezone. You can find the full list of timezones here https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. MONGO_AUTHSOURCE: ${ROOT_AUTHSOURCE_DB} # Fill in the value in both the .env and stack.env files MONGO_HOST: ${HOST_DB} # Fill in the value in both the .env and stack.env files MONGO_DBNAME: ${NAME_DB} # Fill in the value in both the .env and stack.env files MONGO_PASS: ${PASSWORD_DB} # Fill in the value in both the .env and stack.env files MONGO_PORT: ${PORT_DB} # Fill in the value in both the .env and stack.env files MONGO_USER: ${USER_DB} # Fill in the value in both the .env and stack.env files BASICAUTH: ${BASICAUTH} # Fill in the value in both the .env and stack.env files # MONGO_URL: ${MONGODB_URL} # Fill in the value in both the .env and stack.env files MEM_LIMIT: 2048 MEM_STARTUP: 2048 # MONGO_TLS: domainname: unifi-network-application.local # Customize this with your own domain, e.g., `unifi-network-application.local` to `unifi-network-application.your-fqdn-here.com`. hostname: unifi-network-application networks: unifi-network-application_net: ipv4_address: 172.20.19.3 ports: - "1900:1900/udp" # Required for Make controller discoverable on L2 - "3478:3478/udp" # Unifi STUN port - "5514:5514/tcp" # Remote syslog port - "6789:6789/tcp" # For mobile throughput test - "8080:8080/tcp" # Required for device communication - "8443:8443/tcp" # Unifi web admin port - "8843:8843/tcp" # Unifi guest portal HTTPS redirect port - "8880:8880/tcp" # Unifi guest portal HTTP redirect port - "10001:10001/udp" # Required for AP discovery security_opt: - no-new-privileges:true labels: com.unifi-network-application.description: "is an end-to-end system of network devices across different locations — all controlled from a single interface." healthcheck: disable: true