KONG安裝配置

1, sudo docker network create kong-net

2, sudo docker run -d --name kong-database --network=kong-net -p 5432:5432 -e "POSTGRES_USER=kong" -e "POSTGRES_DB=kong" -e "POSTGRES_PASSWORD=kong" postgres:9.6

(注意:password是必須設(shè)置的,還可以設(shè)置"POSTGRES_HOST_AUTH_METHOD=trust")
如果不設(shè)置postgres_password,會(huì)出現(xiàn)如下bug
Error: Database is uninitialized and superuser password is not specified.
?????? You must specify POSTGRES_PASSWORD to a non-empty value for the
?????? superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".

?????? You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
?????? connections without a password. This is *not* recommended.

?????? See PostgreSQL documentation about "trust":
?????? https://www.postgresql.org/docs/current/auth-trust.html


3, sudo docker run --rm --network=kong-net -e "KONG_DATABASE=postgres" -e "KONG_PG_HOST=kong-database" -e "KONG_PG_USER=kong" -e "KONG_PG_PASSWORD=kong" -e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" kong/kong kong migrations bootstrap

4, sudo docker run -d --name kong --network=kong-net -e "KONG_DATABASE=postgres" -e "KONG_PG_HOST=kong-database" -e "KONG_PG_PASSWORD=kong" -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/kong


5, sudo docker run -d -p 1337:1337 --network kong-net -e "TOKEN_SECRET=kongtoken" -e "DB_ADAPTER=postgres" -e "DB_HOST=kong-database" -e "DB_USER=kong"? -e "DB_PASSWORD=kong" --name konga pantsel/konga

6, 訪問http://服務(wù)器IP:1337,首次登錄會(huì)需要先注冊(cè)admin,然后進(jìn)入登錄頁(yè)面,然后再填url地址;填kong和http://kong:8001即可連接進(jìn)入

KONGA界面
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容