docker-compose部署kong konga

清疚 2023-05-28 09:50 180阅读 0赞

kong是基于openresty的不错的网关,konga是一种管理kong的可视化开源项目,kong-dashboard也是一种kong的可视化开源项目,但是最近一次更新都是1年前的事了,所以选择了konga,下面是docker-compose部署整套环境的脚本。

  1. version: "3"
  2. networks:
  3. kong-net:
  4. driver: bridge
  5. services:
  6. #######################################
  7. # Postgres: The database used by Kong
  8. #######################################
  9. kong-database:
  10. image: postgres:9.6
  11. restart: always
  12. networks:
  13. - kong-net
  14. environment:
  15. POSTGRES_USER: kong
  16. POSTGRES_DB: kong
  17. POSTGRES_PASSWORD: kong
  18. ports:
  19. - "5432:5432"
  20. healthcheck:
  21. test: ["CMD", "pg_isready", "-U", "kong"]
  22. interval: 5s
  23. timeout: 5s
  24. retries: 5
  25. #######################################
  26. # Kong database migration
  27. #######################################
  28. kong-migration:
  29. image: kong:latest
  30. command: "kong migrations bootstrap"
  31. networks:
  32. - kong-net
  33. restart: on-failure
  34. environment:
  35. - KONG_DATABASE=postgres
  36. - KONG_PG_HOST=kong-database
  37. - KONG_PG_DATABASE=kong
  38. - KONG_PG_PASSWORD=kong
  39. links:
  40. - kong-database
  41. depends_on:
  42. - kong-database
  43. #######################################
  44. # Kong: The API Gateway
  45. #######################################
  46. kong:
  47. image: kong:latest
  48. restart: always
  49. networks:
  50. - kong-net
  51. environment:
  52. KONG_DATABASE: postgres
  53. KONG_PG_HOST: kong-database
  54. KONG_PG_PASSWORD: kong
  55. KONG_PROXY_LISTEN: 0.0.0.0:8000
  56. KONG_PROXY_LISTEN_SSL: 0.0.0.0:8443
  57. KONG_ADMIN_LISTEN: 0.0.0.0:8001
  58. depends_on:
  59. - kong-migration
  60. links:
  61. - kong-database
  62. healthcheck:
  63. test: ["CMD", "curl", "-f", "http://kong:8001"]
  64. interval: 5s
  65. timeout: 2s
  66. retries: 15
  67. ports:
  68. - "8001:8001"
  69. - "8000:8000"
  70. - "8443:8443"
  71. #######################################
  72. # Konga database prepare
  73. #######################################
  74. konga-prepare:
  75. image: pantsel/konga:latest
  76. command: "-c prepare -a postgres -u postgresql://kong:kong@kong-database:5432/konga"
  77. networks:
  78. - kong-net
  79. restart: on-failure
  80. environment:
  81. - KONG_DATABASE=postgres
  82. - KONG_PG_HOST=kong-database
  83. - KONG_PG_DATABASE=konga
  84. - KONG_PG_PASSWORD=kong
  85. links:
  86. - kong-database
  87. depends_on:
  88. - kong-database
  89. #######################################
  90. # Konga: Kong GUI
  91. #######################################
  92. konga:
  93. image: pantsel/konga:latest
  94. restart: always
  95. networks:
  96. - kong-net
  97. environment:
  98. DB_ADAPTER: postgres
  99. DB_URI: postgresql://kong:kong@kong-database:5432/konga
  100. NODE_ENV: production
  101. links:
  102. - kong-database
  103. depends_on:
  104. - kong
  105. - konga-prepare
  106. ports:
  107. - "1337:1337"

部署效果:

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2pvaG4xMzM3_size_16_color_FFFFFF_t_70

发表评论

表情:
评论列表 (有 0 条评论,180人围观)

还没有评论,来说两句吧...

相关阅读

    相关 KONGKONGA部署及配置

    个人理解,仅供参考: 首先,kong+konga除去其他高级功能,个人觉得就是把nginx,变成可以页面配置的了。比如,配置的router,service就是反向代理,配置