docker-compose-alpine.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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:
  20. build:
  21. context: ./..
  22. dockerfile: alpine/Dockerfile
  23. args:
  24. APISIX_VERSION: master
  25. restart: always
  26. volumes:
  27. - ./apisix_log:/usr/local/apisix/logs
  28. - ./apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml:ro
  29. depends_on:
  30. - etcd
  31. ports:
  32. - "9080:9080/tcp"
  33. - "9091:9091/tcp"
  34. - "9443:9443/tcp"
  35. - "9092:9092/tcp"
  36. networks:
  37. apisix:
  38. etcd:
  39. image: bitnami/etcd:3.4.9
  40. restart: always
  41. volumes:
  42. - etcd_data:/bitnami/etcd
  43. environment:
  44. ETCD_DATA_DIR: /etcd_data
  45. ETCD_ENABLE_V2: "true"
  46. ALLOW_NONE_AUTHENTICATION: "yes"
  47. ETCD_ADVERTISE_CLIENT_URLS: "http://0.0.0.0:2379"
  48. ETCD_LISTEN_CLIENT_URLS: "http://0.0.0.0:2379"
  49. ports:
  50. - "2379:2379/tcp"
  51. networks:
  52. apisix:
  53. web1:
  54. image: nginx:1.18.0-alpine
  55. restart: always
  56. volumes:
  57. - ./upstream/web1.conf:/etc/nginx/nginx.conf
  58. ports:
  59. - "9081:80/tcp"
  60. environment:
  61. - NGINX_PORT=80
  62. networks:
  63. apisix:
  64. web2:
  65. image: nginx:1.18.0-alpine
  66. restart: always
  67. volumes:
  68. - ./upstream/web2.conf:/etc/nginx/nginx.conf
  69. ports:
  70. - "9082:80/tcp"
  71. environment:
  72. - NGINX_PORT=80
  73. networks:
  74. apisix:
  75. networks:
  76. apisix:
  77. driver: bridge
  78. volumes:
  79. etcd_data:
  80. driver: local