部署redis:
编写docker-compose.yml
version: '3' services: redis: image: redis container_name: redis hostname: redis restart: always ports: - 6379:6379 networks: - net_db volumes: - ./conf/redis.conf:/etc/redis/redis.conf:rw - ./data:/data:rw command: redis-server /etc/redis/redis.conf --appendonly yes networks: net_db: driver: bridge
=====================================================================
部署rabbitmq:
编写docker-compose.yml
version: '3'
services:
rabbitmq:
image: rabbitmq:3.8.3-management
container_name: rabbitmq
restart: always
hostname: myRabbitmq
ports:
- 15672:15672
- 5672:5672
volumes:
- ./data:/var/lib/rabbitmq
environment:
- RABBITMQ_DEFAULT_USER=root
- RABBITMQ_DEFAULT_PASS=root