微服务打包Docker镜像
Python微服务打包Docker镜像
-
编写app.py
mkdir ~/python cd ~/python vim app.py #!/usr/bin/python3 from werkzeug.serving import make_server def demo_app(environ, start_response): start_response('200 OK', [('Content-Type', 'text/html; charset=utf-8')]) return ['hello xiaotian'.encode('utf8')] # 浏览器显示的内容 if __name__ == '__main__': httpd = make_server('0.0.0.0', 8080, demo_app) sa = httpd.socket.getsockname() pr