Think before you speak, read before you think.

docker-compose

sudo pip install -U docker-compose

编写

version: '3.2'
services:
  db:
    image: mysql:5.7.21
    container_name: mysql
    hostname: mysql-test-1
    restart: always
    ports:
      - 3306:3306
    environment:
      - MYSQL_ALLOW_EMPTY_PASSWORD=YES
    volumes:
      - ./tmp:/var/lib/mysql

  broker:
    image: redis:3.0-alpine
    command: redis-server 
    container_name: broker
    hostname: broker-test-1
    restart: always
    ports:
      - 6379:6379
    volumes:
      - ./tmp:/var/lib/redis

拉起 docker

docker-compose up -d

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *