Use docker compose for unifi controller.
This commit is contained in:
parent
a04b52ec72
commit
6fc16362ba
42
router/unifi/docker-compose/docker-compose.yaml
Normal file
42
router/unifi/docker-compose/docker-compose.yaml
Normal file
@ -0,0 +1,42 @@
|
||||
# docker-compose up -d
|
||||
---
|
||||
version: "2.1"
|
||||
services:
|
||||
unifi-network-application:
|
||||
image: lscr.io/linuxserver/unifi-network-application:latest
|
||||
container_name: unifi-network-application
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=Etc/UTC
|
||||
- MONGO_USER=unifi
|
||||
- MONGO_PASS=unifipw
|
||||
- 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:
|
||||
- /data/unifi:/config
|
||||
ports:
|
||||
- 80:8080
|
||||
- 443:8443
|
||||
- 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
|
||||
unifi-db:
|
||||
image: mongo:7.0.5
|
||||
container_name: unifi-db
|
||||
volumes:
|
||||
- /data/mongodb:/data/db
|
||||
- ./init_mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
|
||||
restart: unless-stopped
|
2
router/unifi/docker-compose/init_mongo.js
Normal file
2
router/unifi/docker-compose/init_mongo.js
Normal file
@ -0,0 +1,2 @@
|
||||
db.getSiblingDB("unifi").createUser({user: "unifi", pwd: "unifipw", roles: [{role: "dbOwner", db: "unifi"}]});
|
||||
db.getSiblingDB("unifi_stat").createUser({user: "unifi", pwd: "unifipw", roles: [{role: "dbOwner", db: "MONGO_DBNAME_stat"}]});
|
Loading…
Reference in New Issue
Block a user