使用 docker/docker-compose 将《流畅的Python》的 flags 图片部署在本地服务器
问题
File not found (404 error)
If you think what you’re looking for should be here, please contact the site owner.
《流畅的 Python》 一书的第 17 章关于 future 内容,里面通过请求多国国旗来演示并发。
但是其官方的多国国旗服务器已经不可用(如文章开头 404 图片);所以为了动手实践,运行程序,有必要将国旗(flags)部署到本地。
官方 example-code 中有 flags.zip
文件夹;也提供了本地部署的教程。
但是它是“系统级”部署的,而且对于 Mac OS 来说,就我个人而言看着不舒服 – 毕竟我对 Ubuntu/Debain 的系统目录结构比较熟。
所以,我决定自己写一份 docker 部署 flags 的版本。
Solution
细节 - N/A
命令:
% git clone --depth=1 https://github.com/RDpWTeHM/fluent-python-notebooks.git
% cd fluent-python-notebooks/17-futures/countries/composeflags
% cp ../flags.zip .
% docker-compose up
...
now, you can access flags from localhost:8011
;
eg: http://localhost:8011/flags/ae/ae.gif
.
Reference
N/A