Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 670 Bytes

da-jian-redis-fu-wu-xiu-gai-duan-kou.md

File metadata and controls

44 lines (31 loc) · 670 Bytes

搭建redis服务-修改端口

我们现在想要创建开启在6380端口的redis服务。

创建并修改redis.conf

{% file src="../.gitbook/assets/redis.conf" %}

创建Dockerfile

FROM redis 
COPY redis.conf /usr/local/redis/redis/config
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]

创建docker-compose.yml

version: "3"

services:
  redis_6380:
    build: 
      context: .
      dockerfile: Dockerfile
    restart: always
    ports:
      - "6380:6380"
    volumes:
      - redis-db:/data

volumes:
  redis-db:

启动docker服务

docker-compose up -d