Category: redis

docker-compose start Redis with passworddocker-compose start Redis with password

方案一 在 docker-compose.yml 文件中写入下列内容: redis: image: redis container_name: my_redis command: redis-server /usr/local/etc/redis/redis.conf ports: - "6379:6379" volumes: - ./data:/data - ./redis.conf:/usr/local/etc/redis/redis.conf 其中: image 代表镜像名称; container_name 代表生成的容器名称; command 代表生成容器后要执行的命令; ports 将容器内的端口映射到容器外; volumes