version: ‘3‘
services:
redis:
image: redis:latest
container_name: redis
restart: always
ports:
- 6379:6379
networks:
- mynetwork
volumes:
- ./redis.conf:/usr/local/etc/redis/redis.conf:rw
- ./data:/data:rw
command:
/bin/bash -c "redis-server /usr/local/etc/redis/redis.conf "
networks:
mynetwork:
external: true
原文:https://www.cnblogs.com/shunWcs/p/14929255.html