Usando o KONG com KONGA, um dos melhores e gratuitos API Gateways
# Iniciando um container com PostgreSQLdocker run -d --name kong-database \ --hostname kong-database \ -p 5432:5432 \ -e "POSTGRES_USER=kong" \ -e "POSTGRES_DB=kong" \ -e "POSTGRES_PORT=1234" \ -e "POSTGRES_PASSWORD=kong" \ postgres:9.6
# Iniciando um container com o Kongdocker run -d --name kong \ -e "KONG_DATABASE=postgres" -e "KONG_PG_HOST=kong-database" \ -e "KONG_LOG_LEVEL=info" \ -e "KONG_CUSTOM_PLUGINS=helloworld" \ -e "KONG_PG_HOST=1.1.1.1" \ -e "KONG_PG_PORT=1234" \ -e "KONG_PG_USER=postgres" \ -e "KONG_PG_PASSWORD=postgres" \ -e "KONG_PG_SCHEMA=kong" \ -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
# Iniciando um container com o Konga$ docker run -p 1337:1337 --network {{kong-network}} \ // optional -e "TOKEN_SECRET={{somerandomstring}}" \ -e "DB_ADAPTER=the-name-of-the-adapter" \ // 'mongo','postgres','sqlserver' or 'mysql' -e "DB_HOST=your-db-hostname" \ -e "DB_PORT=your-db-port" \ // Defaults to the default db port -e "DB_USER=your-db-user" \ // Omit if not relevant -e "DB_PASSWORD=your-db-password" \ // Omit if not relevant -e "DB_DATABASE=your-db-name" \ // Defaults to 'konga_database' -e "DB_PG_SCHEMA=my-schema"\ // Optionally define a schema when integrating with prostgres -e "NODE_ENV=production" \ // or 'development' | defaults to 'development' --name konga \ pantsel/konga
Referencias
Tutorial ótimo para instalar Kong + PostgreSQL + Konga (melhor que a documentação oficial)
https://dev.to/vousmeevoyez/setup-kong-konga-part-2-dan
Docker Hub do Kong
https://hub.docker.com/_/kong/
Docker Hub do PostgreSQL
https://hub.docker.com/_/postgres
Documentação de instalação do Konga
https://github.com/pantsel/konga#installation
Arquivo de configuração do Kong
https://github.com/Kong/kong/blob/master/kong.conf.default