Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Docker of simple web Server based on flask

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

In fact, it is to replace the deployment operation of the web server in the form of docker, that is, to implement the deployment operation with dockerfile.

Here's dockerfile.

FROM ubuntuMAINTAINER shuaibing.huo@gmail.comRUN apt-get updateRUN apt-get install-y curl git unzip python-zmq vimRUN apt-get install-y python-flaskWORKDIR / workADD app.py. CMD ["python", "app.py"] EXPOSE 8080

Then build the dockerfile into an image, modify the tag, change it to username/docker_images_name (where username is the user name of your own docker hub), and push it to docker hub after the modification.

Go to your own server and pull the previous image from the docker hub; after pulling, execute

Docker run-d-name flask-p 8080 xxxxx/flask_docker:latest

Where flask_docker is the name of the image I made myself.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report