首页 > 解决方案 > 使用 docker 更改 httpd.conf 文件中的参数

问题描述

我使用码头工人。我尝试更改 httpd.conf 文件上的参数 Timeout:

TypesConfig '/etc/mime.types'


<IfVersion < 2.4>
DefaultType text/plain
</IfVersion>

TypesConfig '/etc/mime.types'

HostnameLookups Off
MaxMemFree 64
Timeout 60
ListenBacklog 500

<IfDefine MOD_WSGI_WITH_HTTP2>
Protocols h2 h2c http/1.1
</IfDefine>

<IfVersion >= 2.2.15>
RequestReadTimeout header=15-30,MinRate=500 body=15,MinRate=500
</IfVersion>

LimitRequestBody 1073741824

问题是它需要重新启动 docker 以通过docker downanddocker-compose up -d命令保存更改并重新创建文件。

如何在上传 docker 之前更改 Timeout 参数?

标签: pythondjangodocker

解决方案


而不是从 docker 实例中设置值。尝试在项目中重新创建文件,然后使用卷引用它:

version: "3"
services:
  #assuming the following service is the one that has the conf file
  app:
    volumes:
      - /path/inside/instance/to/httpd.conf:./path/in/app/folder/to/httpd.conf
    #other settings ...

然后您可以对该文件进行任何编辑,它将覆盖另一个文件。之后不要忘记重新启动 docker。


推荐阅读