Skip to content

Instantly share code, notes, and snippets.

@abdul
Forked from linucksrox/docker-compose.yml
Created December 15, 2023 12:23
Show Gist options
  • Save abdul/49553d3d1b5322545a69a9cf1cc5c961 to your computer and use it in GitHub Desktop.
Save abdul/49553d3d1b5322545a69a9cf1cc5c961 to your computer and use it in GitHub Desktop.

Revisions

  1. @linucksrox linucksrox created this gist Nov 21, 2023.
    41 changes: 41 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,41 @@
    version: '3.7'

    services:

    unifi-db:
    image: docker.io/mongo:latest
    container_name: unifi-db
    volumes:
    - ./data:/data/db
    - ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
    restart: unless-stopped

    unifi-network-application:
    image: lscr.io/linuxserver/unifi-network-application:8.0.7
    container_name: unifi-network-application
    environment:
    - PUID=1000
    - PGID=1000
    - TZ=Etc/UTC
    - MONGO_USER=unifi
    - MONGO_PASS=GETYOUROWNPASSWORD
    - MONGO_HOST=unifi-db
    - MONGO_PORT=27017
    - MONGO_DBNAME=unifi
    - MEM_LIMIT=1024 #optional
    - MEM_STARTUP=1024 #optional
    - MONGO_TLS= #optional
    - MONGO_AUTHSOURCE= #optional
    volumes:
    - ./config:/config
    ports:
    - 8443:8443
    - 3478:3478/udp
    - 10001:10001/udp
    - 8080:8080
    - 1900:1900/udp #optional
    - 8843:8843 #optional
    - 8880:8880 #optional
    - 6789:6789 #optional
    - 5514:5514/udp #optional
    restart: unless-stopped
    2 changes: 2 additions & 0 deletions init-mongo.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    db.getSiblingDB("unifi").createUser({user: "unifi", pwd: "GETYOUROWNPASSWORD", roles: [{role: "dbOwner", db: "unifi"}]});
    db.getSiblingDB("unifi_stat").createUser({user: "unifi", pwd: "GETYOUROWNPASSWORD", roles: [{role: "dbOwner", db: "unifi_stat"}]});