容器内没有安装curl 验证web服务存在 在容器内执命令 连接数据库
python -c "import urllib.request; print(urllib.request.urlopen('http://1.0.1.1:9000/health').read())"
docker exec my-container python -c "from src.core.config import get_settings; s=get_settings(); print('test_port=', s.env_settings.http_proxy_test_port)"
docker exec test-worker python -c "import urllib.request; print(urllib.request.urlopen('http://1.0.1.8:9000/health').read())"
b'{"status":"ok"}'
docker exec test-worke python -c "from src.core.database import get_database; print(get_database().fetch_scalar('SELECT 1'))"
打印显示优化
import ppint

浙公网安备 33010602011771号