Docker-compose開梱即用

2944 ワード

以下はネットワークenv-netに依存して事前に作成する必要があります
mysql5.7,redis,zookeeper,activemq
version: "3.4"
services:
  mysql_3306:
    container_name: mysql_3306
    environment:
      MYSQL_ROOT_PASSWORD: "root"
    image: mysql:5.7
    networks:
    - env-net
    ports:
    - "3306:3306"
    volumes:
    - /data/local/mysql/3306/conf:/etc/mysql/conf.d
    - /data/local/mysql/3306/data:/var/lib/mysql
    deploy:
      restart_policy:
        condition: always
  redis_6379:
    container_name: redis_6379
    image: redis
    networks:
    - env-net
    ports:
    - "6379:6379"
    volumes:
    - /data/local/redis/6379/data:/data
    command: 
    - --requirepass "root"
    - --appendonly "yes"
    deploy:
      restart_policy:
        condition: always
  zookeeper_2181:
    container_name: zookeeper_2181
    image: zookeeper
    hostname: zookeeper_1
    networks:
    - env-net
    ports:
      - 2181:2181
    volumes:
      - /data/local/zookeeper/2181/data:/data
      - /data/local/zookeeper/2181/datalog:/datalog
    deploy:
      restart_policy:
        condition: always
  activemq_61616:
    container_name: activemq_81616
    image: webcenter/activemq
    ports:
      - 61616:61616
      - 8161:8161
    volumes:
      - /data/local/activemq/61616/data:/data/activemq
      - /data/local/activemq/61616/log:/var/log/activemq
    deploy:
      restart_policy:
        condition: always
networks:
  env-net:
    external: true

elasticsearch,kibana,cerebro
version: '2.2'
services:
  cerebro:
    image: lmenezes/cerebro:0.8.4
    container_name: cerebro
    ports:
      - "9100:9000"
    command:
      - -Dhosts.0.host=http://elasticsearch:9200
    networks:
      - env-net
  kibana:
    image: kibana:7.5.0
    container_name: kibana750
    environment:
      - XPACK_GRAPH_ENABLED=true
      - TIMELION_ENABLED=true
      - XPACK_MONITORING_COLLECTION_ENABLED="true"
    ports:
      - "5601:5601"
    networks:
      - env-net
  elasticsearch:
    image: elasticsearch:7.5.0
    container_name: es750
    environment:
      - cluster.name=es1
      - node.name=es750
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms1g -Xmx1g"
      - discovery.seed_hosts=es750
      - cluster.initial_master_nodes=es750
      - max_map_count=262144
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - /data/local/elasticsearch/9200:/Users/es1/dockerdata/elasticsearch/data
    ports:
      - 9200:9200
      - 9300:9300
    networks:
      - env-net

networks:
  env-net:
    driver: bridge

発生する可能性のある問題esの起動に失敗しました.具体的なエラーは、その時の解決策を忘れました.ホストは次のコードを実行します.
sysctl -w vm.max_map_count=262144 

docker-composeコマンド
#    
docker-compose pull
#  
docker-compose up
#    
docker-compose up -d