该教程适用于微信云托管

非微信云托管请参考一键部署 Docker部署合集

Dockerfile

FROM jinzhengba/redis:7.0.8
MAINTAINER jinzhengba
# 设置时区
RUN ["rm","-rf","/etc/localtime"]
RUN ["ln","-sf","/usr/share/zoneinfo/Asia/Shanghai","/etc/localtime"]
# 设置密码
RUN echo '\nrequirepass password' >> /usr/local/etc/redis/redis.conf
EXPOSE 6379
CMD ["redis-server","/usr/local/etc/redis/redis.conf"]

进入Webshell查看内网IP

cat /app/cert.log

User is root, patching env and certs.
[I]: os release is debian
[I]: /etc/hosts
# Kubernetes-managed hosts file.
127.0.0.1       localhost
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
fe00::0 ip6-mcastprefix
fe00::1 ip6-allnodes
fe00::2 ip6-allrouters
10.x.x.xx       wechat-redis-001-abcdefghij-klmno
169.254.10.1 api.weixin.qq.com

10.x.x.xx 则是内网IP,每次部署IP会重新分配,建议部署两个服务交替更新

文章作者: Captain
版权声明: 本站所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 One piece
教程
喜欢就支持一下吧