[[My示例代码看起来像这样,它在localhost上工作得很好,我用docker run -p 6379:6379 -it启动了redis服务器redis/redis-stack-server:latest命令,但是当我用docker-compose文件启动redis服务器时,我在set命令上没有得到错误,但是在get命令上得到了未定义的值,为什么
docker-compose.yml文件是这样的版本:'3'服务:nginx:image:127.0.0.1:5000/socketmw_nginx build:./nginx链接:- socketio-1 - socketio-2 - socketio-3 - socketio-4端口:- '88:88'重启:总是
socketio-1:image:127.0.0.1:5000/socketmw_s1 build:./service links:- redis-adapter - redis-cache-db environment:- NAME=socketio-1 restart:always depends_on:- redis-adapter - redis-cache-db
socketio-2:image:127.0.0.1:5000/socketmw_s2 build:./service links:- redis-adapter - redis-cache-db environment:- NAME=socketio-2 restart:always depends_on:- redis-adapter - redis-cache-db
socketio-3:image:127.0.0.1:5000/socketmw_s3 build:./service links:- redis-adapter - redis-cache-db environment:- NAME=socketio-3 restart:always depends_on:- redis-adapter - redis-cache-db
socketio-4:image:127.0.0.1:5000/socketmw_s4 build:./service links:- redis-adapter - redis-cache-db environment:- NAME=socketio-4 restart:always depends_on:- redis-adapter - redis-cache-db
redis-adapter:image:redis:alpine restart:always
redis-cache-db:image:'redis:7.2.3' ports:- '6380:6380'命令:redis-server --保存10 1 --appendonly yes --port 6380
1条答案
按热度按时间jexiocij1#
字符串