Created
November 21, 2023 18:49
-
-
Save linucksrox/8d994f8b53070978a0c4842ac4964f07 to your computer and use it in GitHub Desktop.
Unifi Network Application 8.0.7 with mongodb - docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"}]}); |
Thanks. I verified the javascript file is in the right place. But, I've
been using container manager for this work so it seems I will need to ssh
to the synology and run these commands. I can only open the terminal on
the running container.
Thanks again.
…On Thu, Feb 27, 2025 at 8:00 PM Eric Daly ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
If you use docker compose up -d then you can immediately run docker
compose logs -f. Alternatively, don't run in detached mode and you'll get
logs directly from stdout with just docker compose up
For the mongo container, you need that init-mongo.js file in the same
directory as the docker compose file for that bind mount on line 10.
Without that it won't initialize the unifi database.
Share the logs and we can go from there.
Also docker ps is useful to check what the container is doing if you're
not getting logs from it.
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/linucksrox/8d994f8b53070978a0c4842ac4964f07#gistcomment-5460527>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGUKRXZN5XIW5NQ3YWSP3LL2R6YMJBFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDUOJ2WLJDOMFWWLO3UNBZGKYLEL5YGC4TUNFRWS4DBNZ2F6YLDORUXM2LUPGBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVEYTENRUGM4DIMJTU52HE2LHM5SXFJTDOJSWC5DF>
.
You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you use
docker compose up -d
then you can immediately rundocker compose logs -f
. Alternatively, don't run in detached mode and you'll get logs directly from stdout with justdocker compose up
For the mongo container, you need that init-mongo.js file in the same directory as the docker compose file for that bind mount on line 10. Without that it won't initialize the unifi database.
If you've already tried and failed, make sure you clear out the existing database in the
data
folder between retries. You need to create that empty folder if it doesn't exist already.Share the logs and we can go from there.
Also
docker ps
is useful to check what the container is doing if you're not getting logs from it.