Docker Install

This is the place to discuss DynFi Manager installation and deployment.
Not to be confused with DynFi Firewall installation.

Moderator: gregober

Post Reply
SMiTTY4x4
Posts: 1
Joined: 04 Dec 2023, 22:17

Docker Install

Post by SMiTTY4x4 » 05 Dec 2023, 19:41

I found that the links to docker were very old, and really didn't work well. I prefer Ubuntu, so feel free to modify to you hearts content :)
1. Download https://dynfi.com/files/dynfi/dynfi-23.2.2-all.jar
2. Place all of these in a single directory and run docker compoes up -d or docker-compose up -d
3. Adjust the location of your dynfi.conf and make any changes you see fit. I have Agent Connection enabled in mine
4. Access your Dynfi Manager on http://localhost:9090

This was an attempt to fix old documentation. Maybe I'll create docker images and do away with the Dockerfiles. It could be so much more robust :)


Dockerfile_Java

Code: Select all

FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

RUN \
  apt update && apt -y install gnupg wget openjdk-11-jre-headless apt-utils && \
  apt-get clean && rm -rf /var/lib/apt/lists/*

  
# install Mongo Shell
RUN \
  wget -qO - "https://pgp.mongodb.com/server-6.0.asc" | gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg --dearmor && \
  echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | tee "/etc/apt/sources.list.d/mongodb-org-6.0.list" && \
  apt update && apt -y install mongodb-org

# Create DIR config
RUN mkdir -p /data/conf

WORKDIR /data/app

COPY dynfi-23.2.2-all.jar .

# Define mountable directories.
VOLUME ["/data/conf"]
Dockerfile_mongo

Code: Select all

FROM ubuntu:22.04

RUN \
  apt update && apt -y install gnupg wget && \
  apt-get clean && rm -rf /var/lib/apt/lists/*

# install Mongo
RUN \
  wget -qO - "https://pgp.mongodb.com/server-6.0.asc" | gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg --dearmor && \
  echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | tee "/etc/apt/sources.list.d/mongodb-org-6.0.list" && \
  apt update && apt -y install mongodb-org
  
# Create dir Mongo
RUN mkdir -p /data/db
RUN chown mongodb:mongodb /data/db


# Define mountable directories.
VOLUME ["/data/db"]

#CMD [ "mongod" ] 
docker-compose.yml

Code: Select all

version: '3'
services:
  dynfiapp:
    container_name: dynfiapp
    hostname: dynfiapp
    build:
      context: ./
      dockerfile: Dockerfile_Java
    volumes:
      - ./dynfi/conf/dynfi.conf:/etc/dynfi.conf
      - ./dynfi/mongo-db:/data/db
    ports:
      - '9090:9090'
    command: 
        java -jar /data/app/dynfi-23.2.2-all.jar --config /etc/dynfi.conf

  dynfidb:
    container_name: dynfidb
    hostname: dynfidb
    build:
      context: ./
      dockerfile: Dockerfile_mongo
    volumes:
      - mongo-db:/data/db
    ports:
      - '27017:27017'
    command: mongod --bind_ip 0.0.0.0


    
volumes:
  mongo-db:
    driver: local
dynfi.conf

Code: Select all

# This is DynFi? Manager configuration file.
# This file must follow properties format: https://en.wikipedia.org/wiki/.properties.
# Run `dynfi help` or visit http://dynfi.com for more help.
connectionAgentPort=2222
ipAndPort=0.0.0.0:9090
useHttps=false
mongoClientUri=mongodb://dynfidb
mongoDatabase=dynfitest
User avatar
gregober
Posts: 237
Joined: 26 Mar 2019, 15:06

Re: Docker Install

Post by gregober » 05 Dec 2023, 20:11

Thanks a lot !!

This is really cool :D

I will make sure that we re-transcript this post in order to make it available and that you'll get the credits for it !

So nice !
Post Reply