下载 docker-compose.yml
version: '2.1' services: mongo: image: "mongo:4.0-xenial" command: --replSet rs0 --smallfiles --oplogSize 128 ports: - "27017:27017" environment: - MONGO_INITDB_ROOT_USERNAME=mongouser - MONGO_INITDB_ROOT_PASSWORD=mongopw elasticsearch: image: elastic/elasticsearch:7.6.0 environment: - cluster.name=docker-cluster - bootstrap.memory_lock=true - "ES_JAVA_OPTS=-Xms512m -Xmx512m" - discovery.type=single-node ports: - "9200:9200" - "9300:9300" ulimits: memlock: soft: -1 hard: -1 nofile: soft: 65536 hard: 65536 kibana: image: elastic/kibana:7.6.0 ports: - "5601:5601"
2、 该命令将以 detached 模式自动启动 Docker Compose 配置中定义的所有容器。docker ps 查看启动容器
<