1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| version: '3.8' networks: my_network: external: true name: xc-network services: redis-26379: # 镜像名 image: redis:7.2.4 # 容器名 container_name: redis-26379 # 重启策略 restart: always privileged: true networks: - my_network # 端口映射 ports: - 26379:6379 environment: # 设置环境变量 时区上海 编码UTF-8 TZ: Asia/Shanghai LANG: en_US.UTF-8 volumes: # 配置文件 - /mnt/redis/conf/redis.conf:/usr/local/etc/redis/redis.conf # 数据文件 - /mnt/redis/data:/data command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
|