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.13-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:3.0.0-debian
  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. - "9180:9180/tcp"
  39. - "9080:9080/tcp"
  40. - "9091:9091/tcp"
  41. - "9443:9443/tcp"
  42. - "9092:9092/tcp"
  43. networks:
  44. apisix:
  45. etcd:
  46. image: bitnami/etcd:3.4.15
  47. restart: always
  48. volumes:
  49. - etcd_data:/bitnami/etcd
  50. environment:
  51. ETCD_ENABLE_V2: "true"
  52. ALLOW_NONE_AUTHENTICATION: "yes"
  53. ETCD_ADVERTISE_CLIENT_URLS: "http://0.0.0.0:2379"
  54. ETCD_LISTEN_CLIENT_URLS: "http://0.0.0.0:2379"
  55. ports:
  56. - "2379:2379/tcp"
  57. networks:
  58. apisix:
  59. web1:
  60. image: nginx:1.19.0-alpine
  61. restart: always
  62. volumes:
  63. - ./upstream/web1.conf:/etc/nginx/nginx.conf
  64. ports:
  65. - "9081:80/tcp"
  66. environment:
  67. - NGINX_PORT=80
  68. networks:
  69. apisix:
  70. web2:
  71. image: nginx:1.19.0-alpine
  72. restart: always
  73. volumes:
  74. - ./upstream/web2.conf:/etc/nginx/nginx.conf
  75. ports:
  76. - "9082:80/tcp"
  77. environment:
  78. - NGINX_PORT=80
  79. networks:
  80. apisix:
  81. prometheus:
  82. image: prom/prometheus:v2.25.0
  83. restart: always
  84. volumes:
  85. - ./prometheus_conf/prometheus.yml:/etc/prometheus/prometheus.yml
  86. ports:
  87. - "9090:9090"
  88. networks:
  89. apisix:
  90. grafana:
  91. image: grafana/grafana:7.3.7
  92. restart: always
  93. ports:
  94. - "3000:3000"
  95. volumes:
  96. - "./grafana_conf/provisioning:/etc/grafana/provisioning"
  97. - "./grafana_conf/dashboards:/var/lib/grafana/dashboards"
  98. - "./grafana_conf/config/grafana.ini:/etc/grafana/grafana.ini"
  99. networks:
  100. apisix:
  101. networks:
  102. apisix:
  103. driver: bridge
  104. volumes:
  105. etcd_data:
  106. driver: local