docker-compose-alpine.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. version: "3"
  2. services:
  3. apisix:
  4. build:
  5. context: ./..
  6. dockerfile: alpine/Dockerfile
  7. args:
  8. APISIX_VERSION: master
  9. restart: always
  10. volumes:
  11. - ./apisix_log:/usr/local/apisix/logs
  12. - ./apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml:ro
  13. depends_on:
  14. - etcd
  15. ports:
  16. - "9080:9080/tcp"
  17. - "9091:9091/tcp"
  18. - "9443:9443/tcp"
  19. networks:
  20. apisix:
  21. etcd:
  22. image: bitnami/etcd:3.4.9
  23. user: root
  24. restart: always
  25. volumes:
  26. - ./etcd_data:/etcd_data
  27. environment:
  28. ETCD_DATA_DIR: /etcd_data
  29. ETCD_ENABLE_V2: "true"
  30. ALLOW_NONE_AUTHENTICATION: "yes"
  31. ETCD_ADVERTISE_CLIENT_URLS: "http://0.0.0.0:2379"
  32. ETCD_LISTEN_CLIENT_URLS: "http://0.0.0.0:2379"
  33. ports:
  34. - "2379:2379/tcp"
  35. networks:
  36. apisix:
  37. web1:
  38. image: nginx:1.18.0-alpine
  39. restart: always
  40. volumes:
  41. - ./upstream/web1.conf:/etc/nginx/nginx.conf
  42. ports:
  43. - "9081:80/tcp"
  44. environment:
  45. - NGINX_PORT=80
  46. networks:
  47. apisix:
  48. web2:
  49. image: nginx:1.18.0-alpine
  50. restart: always
  51. volumes:
  52. - ./upstream/web2.conf:/etc/nginx/nginx.conf
  53. ports:
  54. - "9082:80/tcp"
  55. environment:
  56. - NGINX_PORT=80
  57. networks:
  58. apisix:
  59. networks:
  60. apisix:
  61. driver: bridge