docker-compose redis安装

2020/6/2 redisdocker-compose

构建环境:docker、docker-compose

# 配置文件

vim /docker/docker-compose.yml

version: "3.9"
services:
  myredis:
    image: redis:5.0
    privileged: true
    restart: always
    environment:
      - TZ=Asia/Shanghai
    ports:
      - 6380:6379
    volumes:
      - /docker/redis/redis.conf:/usr/local/etc/redis/redis.conf
      - /docker/redis/data:/data
    command:
      /bin/bash -c "redis-server /usr/local/etc/redis/redis.conf"  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

# 运行

运行:docker-compose up -d
1
Last Updated: 2023/12/4 12:06:46