name: unifi-network-application services: unifi-db: container_name: unifi-db image: docker.io/mongo:3.6 configs: - source: init-mongo.js target: /docker-entrypoint-initdb.d/init-mongo.js environment: - PGID=1000 - PUID=1000 - TZ=Etc/UTC ports: - target: 27017 published: "27017" protocol: tcp restart: unless-stopped # volumes: # - type: bind # source: /CHOOSE-A-PATH/unifi-db # target: /data/db networks: - unifi-bridge privileged: false unifi-network-application: container_name: unifi-network-application depends_on: unifi-db: condition: service_started required: true environment: - MONGO_DBNAME=unifi-db - MONGO_HOST=unifi-db - MONGO_PASS=pass - MONGO_PORT=27017 - MONGO_USER=unifi - PGID=1000 - PUID=1000 - TZ=Etc/UTC image: lscr.io/linuxserver/unifi-network-application:latest ports: - target: 8443 published: "8444" protocol: tcp - target: 3478 published: "3478" protocol: udp - target: 10001 published: "10001" protocol: udp - target: 8080 published: "8181" protocol: tcp # - target: 1900 #optional # published: "1900" # protocol: udp # - target: 8843 #optional # published: "8843" # protocol: tcp # - target: 8880 #optional # published: "8880" # protocol: tcp # - target: 6789 #optional # published: "6789" # protocol: tcp # - target: 5514 #optional # published: "5514" # protocol: udp restart: unless-stopped # volumes: # - type: bind # source: /CHOOSE-A-PATH/unifi-network-application # target: /config networks: - unifi-bridge privileged: false networks: unifi-bridge: driver: bridge configs: init-mongo.js: content: | db.getSiblingDB("unifi-db").createUser({user: "unifi", pwd: "pass", roles: [{role: "dbOwner", db: "unifi-db"}]}); db.getSiblingDB("unifi-db_stat").createUser({user: "unifi", pwd: "pass", roles: [{role: "dbOwner", db: "unifi-db_stat"}]});