docker-unifi-mongo

docker-unifi-mongo

MIT License

Stars
1
Committers
2

docker-unifi-mongo

Table of Contents


Latest Major Version Build CI

3.x 4.x 5.x 6.x 7.x
Dynamic JSON BadgeDynamic JSON BadgeDynamic JSON Badge Dynamic JSON BadgeDynamic JSON BadgeDynamic JSON Badge Dynamic JSON Badge Dynamic JSON BadgeDynamic JSON Badge Dynamic JSON Badge

Quick reference


About

This image is packaged with the required mongo init script to set up linuxserver/unifi-network-application.


Usage

Docker Compose

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 CLI

Create the network

docker network create unifi

Create the volume

docker volume create unifi_mongo_data

Run the MongoDB container

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

Build Your Own Image

docker build -t unifi-mongo:6.0.15 --build-arg MONGO_VERSION=6.0.15 . 

Adding your own scripts

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.

Disclaimer

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.

Badges
Extracted from project README
Build CI