docker-compose.yml
version: "3.8"services: # elasticsearch container elasticsearch0: container_name: portal_elasticsearch hostname: elasticsearch image: "docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION}" environment: - http.host=0.0.0.0 - transport.host=127.0.0.1 - bootstrap.memory_lock=true - "ES_JAVA_OPTS=-Xms${ES_JVM_HEAP} -Xmx${ES_JVM_HEAP}" mem_limit: ${ES_MEM_LIMIT} ulimits: memlock: soft: -1 hard: -1 volumes: - ./config/elasticsearch/elasticsearch.yml:/usr/share/elasticsearch/elasticsearch.yml - esdata0:/usr/share/elasticsearch/data ports: ["${ELASTIC_PORT}:9200"] healthcheck: test: ["CMD", "curl","-s" ,"-f", "-u", "elastic:${ES_PASSWORD}", "http://localhost:9200/_cat/health"] networks: ['stack'] elasticsearch1: container_name: core_elasticsearch hostname: elasticsearch image: "docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION}" environment: - http.host=0.0.0.0 - transport.host=127.0.0.1 - bootstrap.memory_lock=true - "ES_JAVA_OPTS=-Xms${ES_JVM_HEAP} -Xmx${ES_JVM_HEAP}" mem_limit: ${ES_MEM_LIMIT} ulimits: memlock: soft: -1 hard: -1 volumes: - ./config/elasticsearch/elasticsearch.yml:/usr/share/elasticsearch/elasticsearch.yml - esdata1:/usr/share/elasticsearch/data ports: ["${CORE_ELASTIC_PORT}:9200"] healthcheck: test: ["CMD", "curl","-s" ,"-f", "-u", "elastic:${ES_PASSWORD}", "http://localhost:9200/_cat/health"] networks: ['stack'] elasticsearch2: container_name: local_elasticsearch hostname: elasticsearch image: "docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION}" environment: - http.host=0.0.0.0 - transport.host=127.0.0.1 - bootstrap.memory_lock=true - "ES_JAVA_OPTS=-Xms${ES_JVM_HEAP} -Xmx${ES_JVM_HEAP}" mem_limit: ${ES_MEM_LIMIT} ulimits: memlock: soft: -1 hard: -1 volumes: - ./config/elasticsearch/elasticsearch.yml:/usr/share/elasticsearch/elasticsearch.yml - esdata2:/usr/share/elasticsearch/data ports: ["9210:9200"] healthcheck: test: ["CMD", "curl","-s" ,"-f", "-u", "elastic:${ES_PASSWORD}", "http://localhost:9200/_cat/health"] networks: ['stack'] elasticsearch3: container_name: income_elasticsearch hostname: elasticsearch image: "docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION}" environment: - http.host=0.0.0.0 - transport.host=127.0.0.1 - bootstrap.memory_lock=true - "ES_JAVA_OPTS=-Xms${ES_JVM_HEAP} -Xmx${ES_JVM_HEAP}" mem_limit: ${ES_MEM_LIMIT} ulimits: memlock: soft: -1 hard: -1 volumes: - ./config/elasticsearch/elasticsearch.yml:/usr/share/elasticsearch/elasticsearch.yml - esdata3:/usr/share/elasticsearch/data ports: ["${BIX_ELASTIC_PORT}:9200"] healthcheck: test: ["CMD", "curl","-s" ,"-f", "-u", "elastic:${ES_PASSWORD}", "http://localhost:9200/_cat/health"] networks: ['stack'] kibana: image: kibana:${KIBANA_VERSION} container_name: kibana environment: - ELASTICSEARCH_HOSTS=http://income_elasticsearch:9200 # connect the es-balance node - I18N_LOCALE=zh-CN #汉化 - XPACK_GRAPH_ENABLED=true - TIMELION_ENABLED=true - XPACK_MONITORING_COLLECTION_ENABLED="true" ports: - "${KIBANA_PORT}:5601" networks: ['stack'] # Mysql container mysql0: container_name: local_mqsql hostname: mysql image: "mysql:${MYSQL_VERSION}" build: ./config/mysql environment: - "MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}" networks: ['stack'] command: --lower_case_table_names=1 ports: ["${MYSQL_PORT}:3306"] volumes: - mysqldata0:/var/lib/mysql/ - .\logs\mysql:/var/log/mysql/ - .\config\mysql\conf-file.cnf:/etc/mysql/conf.d/conf-file.cnf # 首次创建容器时执行,重置 docker-compose down -v - .\config\mysql\initdb.sql:/docker-entrypoint-initdb.d/initdb.sql mysql1: container_name: income_mqsql hostname: mysql image: "mysql:${MYSQL_VERSION}" build: ./config/mysql environment: - "MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}" networks: ['stack'] command: --lower_case_table_names=1 ports: ["${MYSQL_PORT}:3306"] volumes: - mysqldata1:/var/lib/mysql/ - .\logs\mysql:/var/log/mysql/ - .\config\mysql\conf-file.cnf:/etc/mysql/conf.d/conf-file.cnf # 首次创建容器时执行,重置 docker-compose down -v - .\config\mysql\initdb.sql:/docker-entrypoint-initdb.d/initdb.sqlvolumes: # Mysql data mysqldata0: driver: local mysqldata1: driver: local # Es data esdata0: driver: local esdata1: driver: local esdata2: driver: local esdata3: driver: localnetworks: stack: driver: bridge
docker_db_local.txt