运行在Docker容器中的Requestbin不是持久的

我试图在本地运行requestbin( https://requestb.in )。 开始我从这里拿了代码: https : //github.com/Runscope/requestbin 。

本地部署指令是:

$ sudo docker-compose build $ sudo docker-compose up -d 

下面是docker-compose.yml的内容:

 app: build: . environment: REALM: prod REDIS_URL: "//redis:6379" links: - redis ports: - "8000:8000" redis: image: redis 

不幸的是,我不能在我使用的服务器上使用docker compose,所以我把上面的代码翻译成两个docker调用:

 docker run -d --name requestbin_redis redis docker run -d --name requestbin -p 8000:8000 --link requestbin_redis:redis -e REDIS_URL=//redis:6379 repository/requestbin:tag 

也试过了以下:

 docker run -d --name -p 6379:6379 requestbin_redis redis docker run -d --name requestbin -p 8000:8000 --link requestbin_redis:redis -e REDIS_URL=redis://redis:6379/0 repository/requestbin:tag 

Requestbin工作(可用)但请求不被保留。 他们通常可用10-20秒,然后他们走了。 没有历史,没有链接到垃圾箱。 我必须错误地链接到redis。

任何想法可能会导致这种情况,如何排除故障? 以不分离的方式运行不会显示任何内容。 我也试着用debugging标志-e LOGLEVEL = debug来运行redis,但似乎不起作用。

redis的输出:

 $ docker run --name requestbin_redis -e LOGLEVEL=debug redis 1:C 15 Dec 12:26:04.966 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 1:C 15 Dec 12:26:04.966 # Redis version=4.0.6, bits=64, commit=00000000, modified=0, pid=1, just started 1:C 15 Dec 12:26:04.966 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf 1:M 15 Dec 12:26:04.967 * Running mode=standalone, port=6379. 1:M 15 Dec 12:26:04.967 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. 1:M 15 Dec 12:26:04.967 # Server initialized 1:M 15 Dec 12:26:04.968 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. 1:M 15 Dec 12:26:04.968 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled. 1:M 15 Dec 12:26:04.968 * Ready to accept connections 

requestbin输出:

 $ docker run --name requestbin -p 8000:8000 --link requestbin_redis:redis -e REDIS_URL=redis://redis:6379/0 repository/requestbin:tag [2017-12-15 12:24:36 +0000] [7] [INFO] Starting gunicorn 19.7.1 [2017-12-15 12:24:36 +0000] [7] [INFO] Listening at: http://0.0.0.0:8000 (7) [2017-12-15 12:24:36 +0000] [7] [INFO] Using worker: gevent [2017-12-15 12:24:36 +0000] [17] [INFO] Booting worker with pid: 17 [2017-12-15 12:24:36 +0000] [18] [INFO] Booting worker with pid: 18