Compare commits
2 commits
807deb9571
...
ac62e63e8e
Author | SHA1 | Date | |
---|---|---|---|
ac62e63e8e | |||
3577467fb6 |
3 changed files with 46 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
services:
|
services:
|
||||||
syncthing:
|
syncthing:
|
||||||
image: syncthing/syncthing:1.28.0
|
image: syncthing/syncthing:1.30.0
|
||||||
container_name: syncthing
|
container_name: syncthing
|
||||||
hostname: white-syncthing
|
hostname: white-syncthing
|
||||||
environment:
|
environment:
|
||||||
|
|
|
@ -1,11 +1,17 @@
|
||||||
services:
|
services:
|
||||||
unifi-controller:
|
unifi-network-application:
|
||||||
image: lscr.io/linuxserver/unifi-controller:7.1.66
|
image: lscr.io/linuxserver/unifi-network-application:9.3.45
|
||||||
container_name: unifi-controller
|
container_name: unifi-network-application
|
||||||
environment:
|
environment:
|
||||||
- PUID=2300
|
- PUID=2300
|
||||||
- PGID=2300
|
- PGID=2300
|
||||||
- TZ=Etc/UTC
|
- TZ=Etc/UTC
|
||||||
|
- MONGO_USER=unifi
|
||||||
|
- MONGO_HOST=unifi-db
|
||||||
|
- MONGO_PORT=27017
|
||||||
|
- MONGO_DBNAME=unifi
|
||||||
|
- MONGO_AUTHSOURCE=admin
|
||||||
|
- MONGO_PASS=${MONGO_USER_PASS}
|
||||||
- MEM_LIMIT=1024 #optional
|
- MEM_LIMIT=1024 #optional
|
||||||
volumes:
|
volumes:
|
||||||
- ./config:/config
|
- ./config:/config
|
||||||
|
@ -15,3 +21,19 @@ services:
|
||||||
- 10001:10001/udp
|
- 10001:10001/udp
|
||||||
- 7070:7070
|
- 7070:7070
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
|
|
||||||
|
unifi-db:
|
||||||
|
image: docker.io/mongo:8.0
|
||||||
|
container_name: unifi-db
|
||||||
|
environment:
|
||||||
|
- MONGO_INITDB_ROOT_USERNAME=root
|
||||||
|
- MONGO_USER=unifi
|
||||||
|
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_ROOT_PASS}
|
||||||
|
- MONGO_PASS=${MONGO_USER_PASS}
|
||||||
|
- MONGO_DBNAME=unifi
|
||||||
|
- MONGO_AUTHSOURCE=admin
|
||||||
|
volumes:
|
||||||
|
- ./data:/data/db
|
||||||
|
- ./init-mongo.sh:/docker-entrypoint-initdb.d/init-mongo.sh:ro
|
||||||
|
restart: unless-stopped
|
||||||
|
|
20
unifi-controller/init-mongo.sh
Normal file
20
unifi-controller/init-mongo.sh
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if which mongosh > /dev/null 2>&1; then
|
||||||
|
mongo_init_bin='mongosh'
|
||||||
|
else
|
||||||
|
mongo_init_bin='mongo'
|
||||||
|
fi
|
||||||
|
"${mongo_init_bin}" <<EOF
|
||||||
|
use ${MONGO_AUTHSOURCE}
|
||||||
|
db.auth("${MONGO_INITDB_ROOT_USERNAME}", "${MONGO_INITDB_ROOT_PASSWORD}")
|
||||||
|
db.createUser({
|
||||||
|
user: "${MONGO_USER}",
|
||||||
|
pwd: "${MONGO_PASS}",
|
||||||
|
roles: [
|
||||||
|
{ db: "${MONGO_DBNAME}", role: "dbOwner" },
|
||||||
|
{ db: "${MONGO_DBNAME}_stat", role: "dbOwner" },
|
||||||
|
{ db: "${MONGO_DBNAME}_audit", role: "dbOwner" }
|
||||||
|
]
|
||||||
|
})
|
||||||
|
EOF
|
Loading…
Add table
Add a link
Reference in a new issue