Example of how to install kong gateway in docker

Example of how to install kong gateway in docker

1. Create a Docker network

docker network create kong-net

2. Create a database

Take PostgreSQL as an example

docker run -d --name kong-database \
        --network=kong-net \
        -p 5432:5432 \
        -e "POSTGRES_USER=kong" \
        -e "POSTGRES_DB=kong" \
        postgres:9.6

3. Prepare the database

docker run --rm \
   --network=kong-net \
   -e "KONG_DATABASE=postgres" \
   -e "KONG_PG_HOST=kong-database" \
   -e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
   kong:latest kong migrations bootstrap

4. Pull kong and run

docker run -d --name kong \
   --network=kong-net \
   -e "KONG_DATABASE=postgres" \
   -e "KONG_PG_HOST=kong-database" \
   -e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
   -e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
   -e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
   -e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
   -e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
   -e "KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl" \
   -p 8000:8000 \
   -p 8443:8443 \
   -p 8001:8001 \
   -p 8444:8444 \
   kong:latest

5. Install the visual interface konga

docker run -p 1337:1337 \
     --network kong-net \
     -e "TOKEN_SECRET=mark666" \
     -e "DB_ADAPTER=postgres" \
     -e "DB_HOST=0.0.0.0" \ //Pay attention to your IP address, not 0.0.0.0 or 127.0.0.1
     -e "DB_PORT=5432:5432" \
     -e "DB_USER=kong" \
     -e "DB_PASSWORD=kong" \
     -e "DB_DATABASE=kong_database" \
     --name konga \
     pantsel/konga

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Docker pull image and tag operation pull | tag
  • Docker intranet builds DNS and uses domain name access instead of ip:port operation
  • Solve the error during connect exception in Docker
  • Docker container time zone adjustment operation
  • Solve the problem that docker run or docker restart will automatically exit when starting the image
  • Use nexus as a private library to proxy docker to upload and download images
  • Use docker to build kong cluster operation

<<:  Use the vue-element-admin framework to dynamically obtain the menu function from the backend

>>:  Introduction to MySQL isolation level, lock and MVCC

Recommend

In-depth analysis of Nginx virtual host

Table of contents 1. Virtual Host 1.1 Virtual Hos...

In-depth understanding of MySQL global locks and table locks

Preface According to the scope of locking, locks ...

Detailed explanation of Svn one-click installation shell script under linxu

#!/bin/bash #Download SVN yum -y install subversi...

Detailed explanation of the mysql database LIKE operator in python

The LIKE operator is used in the WHERE clause to ...

An enhanced screenshot and sharing tool for Linux: ScreenCloud

ScreenCloud is a great little app you didn’t even...

Summary of some common uses of refs in React

Table of contents What are Refs 1. String type Re...

Navicat connection MySQL error description analysis

Table of contents environment Virtual Machine Ver...

A brief discussion on several advantages of Vue3

Table of contents 1. Source code 1.1 Monorepo 1.2...

Two ways to write stored procedures in Mysql with and without return values

Process 1: with return value: drop procedure if e...

Summary of commonly used escape characters in HTML

The commonly used escape characters in HTML are s...

Combining XML and CSS styles

student.xml <?xml version="1.0" enco...

How to use boost.python to call c++ dynamic library in linux

Preface Recently I started using robot framework ...

JS array deduplication details

Table of contents 1 Test Cases 2 JS array dedupli...