【发布时间】:2020-11-20 03:08:35
【问题描述】:
我的项目在 docker 容器上与主管一起运行。所有 stdout_logfile 文件都存储在“logs”文件夹(在 docker 容器内)中,我需要将它们保存在本地机器上的同一目录中。我添加了卷,但出现套接字错误。 docker-compose.yml:
version: '3'
services:
web:
build: ./
command: bash -c "python manage.py makemigrations && python manage.py migrate && python manage.py collectstatic --noinput --i rest_framework && cd supervisor && supervisord -c supervisord.conf && tail -f /dev/null"
ports:
- "${webport}:8080"
env_file:
- ./.env
links:
- redis
volumes:
- ./logs:/orion-amr/logs
redis:
image: 'bitnami/redis:latest'
container_name: $redishostname
environment:
- REDIS_PASSWORD=$redispassword
volumes:
logs:
但我收到以下错误:
Error: Cannot open an HTTP server: socket.error reported errno.EIO (5)
但是,新的 supervisord.log 文件出现在日志文件夹中(在计算机上)并且有:
2020-07-30 11:15:07,528 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.
2020-07-30 11:15:07,529 INFO Included extra file "/orion-amr/supervisor/conf.d/amr.conf" during parsing
发生了什么事,谁能帮忙?
【问题讨论】:
-
错误来自 supervisord,而不是来自 docker-compose 中应有的挂载日志目录,stackoverflow.com/questions/19918177/… 或 github.com/Supervisor/supervisor/issues/1183
标签: docker docker-compose supervisord