3.x | 4.x | 5.x | 6.x | 7.x |
---|---|---|---|---|
- pjortiz/docker-compose-unifi-network-application
- Mongo Official Image
- linuxserver/unifi-network-application Official Image
This image is packaged with the required mongo init script to set up linuxserver/unifi-network-application.
version: "3.7"
networks:
# proxy-network: # optional, Use this network or your own if you intend to configure the unifi-network-application container through a revers proxy, otherwise not needed.
# external: true
unifi:
volumes: # You can change the volumes' device path if you want, otherwise no need to change, default Docker volume folder location will be used
unifi_mongo_data:
services:
unifi-mongo-db:
image: portiz93/unifi-mongo:${MONGO_VERSION:-6.0.15} # Required MONGO_VERSION, Default "6.0.15", specify whatever Mongo version tag you need. DO NOT set 'latest' tag
container_name: unifi-mongo-db
environment:
# - MONGO_INITDB_ROOT_USERNAME=${MONGO_INITDB_ROOT_USERNAME:-root} # Required only if using mongodb version < 6.0, otherwise do not set (See official Mongo image)
# - MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD:?Root Password Required} # Required only if using mongodb version < 6.0, otherwise do not set (See official Mongo image)
- MONGO_USER=${MONGO_USER:-unifi} # Default "unifi"
- MONGO_PASS=${MONGO_PASS:?Mongo Password Required} # Required
- MONGO_DBNAME=${MONGO_DBNAME:-unifi} # Default "unifi"
volumes:
- unifi_mongo_data:/data/db
# ports:
# - 27017:27017 # optional, Default "27017", only port if needed outside of unifi app
networks:
unifi:
restart: unless-stopped
docker network create unifi
docker volume create unifi_mongo_data
docker run -d \
--name unifi-mongo-db \
--network unifi \
-v unifi_mongo_data:/data/db \
-e MONGO_USER=unifi \
-e MONGO_PASS=your_mongo_password_here \
-e MONGO_DBNAME=unifi \
--restart unless-stopped \
portiz93/unifi-mongo:6.0.15
docker build -t unifi-mongo:6.0.15 --build-arg MONGO_VERSION=6.0.15 .
If you need a custom script based on your needs. After forking/clone this repo create a directory under scripts
with your specific Mongo version tag (e.g. scripts/6.0.15
), then add your script(s) in that new directory. Then run the above build command with your specific version.
I have not validated any of the images as to whether they are working as expected apart from the image(s) I use myself. Please create an issue and I will see if I can address/accommodate your needs.