KONG和KONGA搭建

@liubb  July 5, 2020


安装postgresql

apt-get install -y postgresql

登陆

sudo -u postgres psql

创建用户和数据库

create user kong with password 'kong';
create database kong owner kong;
grant all privileges on database kong to kong;

安装kong 修改kong配置文件 启动

dpkg -i kong-2.0.4.bionic.amd64.deb
mv /etc/kong/kong.conf.default /etc/kong/kong.conf
pg_host = 127.0.0.1
pg_port = 5432
pg_user = kong
pg_password = kong
pg_database = kong
kong migrations bootstrap
kong start

安装konga 创建数据库

create user konga with password 'konga';
create database konga owner konga;
grant all privileges on database konga to konga;

下载镜像

sudo docker pull pantsel/konga:latest

试了几个地址都很慢,用163的镜像加速,秒下

http://hub-mirror.c.163.com

修改postgres配置文件 重启postgres

postgresql.conf listen_addresses 0.0.0.0
pg_hba.conf host  all  all  0.0.0.0/0  md5

启动konga

sudo docker run --rm pantsel/konga:latest -c prepare -a postgres -u postgresql://konga:konga@172.17.0.1:5432/konga
sudo docker run -p 1337:1337 --name konga -e "NODE_ENV=production" -e "DB_ADAPTER=postgres" -e "DB_URI=postgresql://konga:konga@172.17.0.1:5432/konga" pantsel/konga

添加新评论