docker-compose.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. version: "3"
  18. services:
  19. apisix-dashboard:
  20. image: apache/apisix-dashboard:2.10.1-alpine
  21. restart: always
  22. volumes:
  23. - ./dashboard_conf/conf.yaml:/usr/local/apisix-dashboard/conf/conf.yaml
  24. ports:
  25. - "9000:9000"
  26. networks:
  27. apisix:
  28. apisix:
  29. image: apache/apisix:2.11.0-alpine
  30. restart: always
  31. volumes:
  32. - ./apisix_log:/usr/local/apisix/logs
  33. - ./apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml:ro
  34. depends_on:
  35. - etcd
  36. ##network_mode: host
  37. ports:
  38. - "9080:9080/tcp"
  39. - "9091:9091/tcp"
  40. - "9443:9443/tcp"
  41. - "9092:9092/tcp"
  42. networks:
  43. apisix:
  44. etcd:
  45. image: bitnami/etcd:3.4.15
  46. restart: always
  47. volumes:
  48. - etcd_data:/bitnami/etcd
  49. environment:
  50. ETCD_ENABLE_V2: "true"
  51. ALLOW_NONE_AUTHENTICATION: "yes"
  52. ETCD_ADVERTISE_CLIENT_URLS: "http://0.0.0.0:2379"
  53. ETCD_LISTEN_CLIENT_URLS: "http://0.0.0.0:2379"
  54. ports:
  55. - "2379:2379/tcp"
  56. networks:
  57. apisix:
  58. web1:
  59. image: nginx:1.19.0-alpine
  60. restart: always
  61. volumes:
  62. - ./upstream/web1.conf:/etc/nginx/nginx.conf
  63. ports:
  64. - "9081:80/tcp"
  65. environment:
  66. - NGINX_PORT=80
  67. networks:
  68. apisix:
  69. web2:
  70. image: nginx:1.19.0-alpine
  71. restart: always
  72. volumes:
  73. - ./upstream/web2.conf:/etc/nginx/nginx.conf
  74. ports:
  75. - "9082:80/tcp"
  76. environment:
  77. - NGINX_PORT=80
  78. networks:
  79. apisix:
  80. prometheus:
  81. image: prom/prometheus:v2.25.0
  82. restart: always
  83. volumes:
  84. - ./prometheus_conf/prometheus.yml:/etc/prometheus/prometheus.yml
  85. ports:
  86. - "9090:9090"
  87. networks:
  88. apisix:
  89. grafana:
  90. image: grafana/grafana:7.3.7
  91. restart: always
  92. ports:
  93. - "3000:3000"
  94. volumes:
  95. - "./grafana_conf/provisioning:/etc/grafana/provisioning"
  96. - "./grafana_conf/dashboards:/var/lib/grafana/dashboards"
  97. - "./grafana_conf/config/grafana.ini:/etc/grafana/grafana.ini"
  98. networks:
  99. apisix:
  100. networks:
  101. apisix:
  102. driver: bridge
  103. volumes:
  104. etcd_data:
  105. driver: local