python - 使用 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 down
anddocker-compose up -d
命令保存更改并重新创建文件。
如何在上传 docker 之前更改 Timeout 参数?
解决方案
而不是从 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。
推荐阅读
- java - 插件已经存在于 pom.xml 文件中,但仍然出现丢失的错误,没有可用的依赖信息
- javascript - 操作 JSON 对象数组
- c++ - 为什么 pubsetbuf(0, 0) 不使我的流无缓冲?
- python - Python 3 脚本或 gimp script-fu 重新排列彩色地图索引图像
- c# - EF Core - 同一实体的并发保存会创建多个
- java - 如何设置java框架的侧面区域无法?
- java - 我想从应用程序切换到 chrome 网络浏览器,然后导航回 appium 中的同一个应用程序
- php - 灵活地向基础对象添加新功能
- sql - 将 Postgres 自动增量值重置为 0
- heroku - 尝试将全栈应用程序部署到 Heroku,得到错误的响应数据