Docker Compose 安裝 RabbitMQ

漁火照月光發表於2020-12-17
  • 安裝 Docker Compose
curl -L https://get.daocloud.io/docker/compose/releases/download/1.26.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version
  • docker-compose-rabbitmq.yml 檔案
version: '3'
services:
  rabbitmq:
    image: rabbitmq:management-alpine
    container_name: rabbitmq
    environment:
      - RABBITMQ_DEFAULT_USER = guest
      - RABBITMQ_DEFAULT_PASS = guest
    restart: always
    ports:
      - "15672:15672"
      - "5672:5672"
    logging:
      driver: "json-file"
      options:
        max-size: "200k"
        max-file: "10"
  • 啟動rabbitmq
docker-compose -f docker-compose-rabbitmq.yml up -d

相關文章