我有一个使用REST API的应用程序的Docker容器。
我想检查通过docker logs
发生了什么,但是它以奇怪的格式打印:
docker logs -f 2b46ac8629f5
* Running on http://0.0.0.0:9002/ (Press CTRL+C to quit)
172.18.0.5 - - [03/Mar/2019 13:53:38] code 400, message Bad HTTP/0.9 request type
("\x16\x03\x01\x00«\x01\x00\x00§\x03\x03\x0euçÍ'ïá\x98\x12\\W5¥Ä\x01\x08")
172.18.0.5 - - [03/Mar/2019 13:53:38] "«§uçÍ'ïá\W5¥µuìz«Ôw48À,À0̨̩̪À+À/À$À(kÀ#À'gÀ" HTTPStatus.BAD_REQUEST -
是否可以通过某种方式修复这些字符串?
更新:
我的docker-compose文件的一部分如下:
api:
container_name: api
restart: always
build: ./web
ports:
- "9002:9002"
volumes:
- ./myapp.co.cert:/usr/src/app/myapp.co.cert
- /usr/src/app/myapp/static
- ./myapp.co.key:/usr/src/appmyapp.co.key
depends_on:
- postgres
web
容器的Docker文件外观:
cat web/Dockerfile
# For better understanding of what is going on please follow this link:
# https://github.com/docker-library/python/blob/f12c2df135aef8c3f645d90aae582b2c65dbc3b5/3.6/jessie/onbuild/Dockerfile
FROM python:3.6.4-onbuild
# Start myapp API.
CMD ["python", "api.py"]
api.py
使用Python 3.6启动Flask应用程序