docker-compose-alpine.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. - "9092:9092/tcp"
  20. networks:
  21. apisix:
  22. etcd:
  23. image: bitnami/etcd:3.4.9
  24. restart: always
  25. volumes:
  26. - etcd_data:/bitnami/etcd
  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
  62. volumes:
  63. etcd_data:
  64. driver: local