kong Api网关使用(搭配konga)
搭建docker运行环境:
docker-compose :参考https://github.com/Kong/docker-kong/blob/master/compose/docker-compose.yml
可以去dockerHub看部署方式: https://hub.docker.com/_/kong
我这里由于一些原因,写成了bash命令启动模式(使用了hos模式,没有去掉暴露端口)
#!/bin/bash
docker run -d --name kong-database \
-p 5432:5432 \
-e "POSTGRES_USER=kong" \
-e "POSTGRES_DB=kong" \
postgres:9.6
sleep 10
docker run --rm \
--link kong-database:kong-database \
-e "KONG_DATABASE=postgres" \
-e "KONG_PG_HOST=kong-database" \
-e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
kong kong migrations bootstrap
docker run -d --name kong \
-e "KONG_DATABASE=postgres" \
-e "KONG_PG_HOST=127.0.0.1" \
-e "KONG_CASSANDRA_CONTACT_POINT