docker-compose-base.yaml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. mysql:
  20. container_name: mysql
  21. image: mysql:5.7.36
  22. command: --default-authentication-plugin=mysql_native_password
  23. restart: always
  24. environment:
  25. MYSQL_ROOT_PASSWORD: 123456
  26. ports:
  27. - "3306:3306"
  28. healthcheck:
  29. test: mysqladmin ping -h 127.0.0.1 -u root --password=$$MYSQL_ROOT_PASSWORD
  30. interval: 5s
  31. timeout: 60s
  32. retries: 120
  33. zoo1:
  34. image: zookeeper:3.8.0
  35. restart: always
  36. hostname: zoo1
  37. ports:
  38. - "2181:2181"
  39. environment:
  40. ZOO_MY_ID: 1
  41. ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181
  42. zoo2:
  43. image: zookeeper:3.8.0
  44. restart: always
  45. hostname: zoo2
  46. ports:
  47. - "2182:2181"
  48. environment:
  49. ZOO_MY_ID: 2
  50. ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181
  51. zoo3:
  52. image: zookeeper:3.8.0
  53. restart: always
  54. hostname: zoo3
  55. ports:
  56. - "2183:2181"
  57. environment:
  58. ZOO_MY_ID: 3
  59. ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181