How to setup Konga using Docker

Konga is an opensource powerful GUI that uses Kong Admin API, that makes managing of Kong quite literally…. a breeze.

Today we are walking through setting up Konga using docker. We will be making use of PostgreSQL as our persistent database for Konga.

  • First, we want to save PostgreSQL to a permanent folder, and todo that we will be creating a folder for this sole purpose
mkdir -p data
  • Then the next step is to create a Docker network that will house both the PostgreSQL and Konga containers so that they can easily reach each other.
    P.S We could have them on the default network by default, but it is better to create network separation in case you have multiple docker images of the same type running. You do not want them clashing.
docker network create -d bridge main-link
  • Then once done, we run the docker command to startup PostgreSQL using the alpine variant image and binding both the network and volume to the ones specified above. In addition to that, we set the default credentials for the database and set the name of the docker container
docker run --rm \
-e POSTGRES_USER=konga \
-e POSTGRES_DB=konga \
-e POSTGRES_PASSWORD=konga \
-v data:/var/lib/postgresql/data \
--name postgres \
-d --network main-link \
postgres:9.6-alpine
  • Then we need to seed the database with the Konga Schemas from the Konga image, we run the below before we start the Konga image proper.
docker run --network main-link --rm pantsel/konga:latest -c prepare -a postgres -u postgresql://konga:konga@postgres:5432/konga
  • Once the Database has been seeded successfully, then you can start the docker image below.
docker run -p 1337:1337 \  
--network main-link \  
-e "TOKEN_SECRET=ffffssf" \  
-e "DB_ADAPTER=postgres" \  
-e "DB_HOST=postgres" \  
-e "DB_PORT=5432" \  
-e "DB_USER=konga" \  
-e "DB_PASSWORD=konga" \  
-e "DB_DATABASE=konga" \  
-e "NODE_ENV=production" \  
-d --name konga \  
pantsel/konga


Thats it.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *


Keep up, get in touch.

Follow

Instagram / Facebook

Designed with WordPress