Dockerfile文件:

FROM redis

COPY redis.conf /redis/redis.conf

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone

RUN chmod 777 /redis/redis.conf

EXPOSE 6381
EXPOSE 16381

CMD [ "redis-server", "/redis/redis.conf" ]

 

docker-compose.yml文件:

version: '2'
services:
  redis-slave1:
    build: ./slave1
    ports:
      - 6381:6381
      - 16381:16381
    network_mode: "host"
    restart: always
  redis-slave2:
    build: ./slave2
    ports:
      - 6382:6382
      - 16382:16382
    network_mode: "host"
    restart: always

相关文章:

  • 2023-03-24
  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
  • 2021-05-27
猜你喜欢
  • 2020-04-07
  • 2021-08-25
  • 2022-01-04
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案