最近的两个小项目,2:Python webapp的docker镜像
来源:互联网 发布:陈自强 知乎 编辑:程序博客网 时间:2024/06/08 02:52
时间过得真快,一眨眼一个多月没更新了,但这一个月我可没偷懒啊,真的是忙。粘上两篇ReadMe勉强凑合一下,保持博客更新是好习惯。
基于Flask框架,uwsgi起服务,supervisor做管理,应该算是很灵活的了。
flask - docker
Docker image of python webapp.
Pre-installed uwsgi & supervisor, base on python:2.7-alpine
– File structure –
path/to/app - src # Put your webapp(s) source code hear. -- static -- templates -- application.py ... # Folder|module is permitted hear for more then one app. -- app1 ... -- app2 ... ... - share # Used to share with host|other-contains. -- static/... # Convenience to service static files by nginx. -- tmp/uwsgi.sock # Convenience to connect. -- app3 # Convenience to develop and debug. ... - programs.conf # Config-file for supervisor. - requirements.txt # Install your dependencies.
- You can get help from http://supervisord.org/running.html#adding-a-program to see how to write “programs.conf”.
– Build image –
First, add your “Dockerfile”:
FROM zhengxiaoyao0716/flaskMAINTAINER ${your name}EXPOSE port1 port2 ...
Now, you can build your webapp image:
docker build -t <yourImageName> .
– Start container –
docker run --name <appName> \ -p <host-port>:<port> \ -v <volumeDir>:/web/share \ -d <yourImageName>
- –name= Assign a name to the container
- -p, –publish=[] Publish a container’s port(s) to the host
- -v, –volume=[] Bind mount a volume
- -d, –detach=false Run container in background and print container ID
Now your container will running in background.
Maybe you need to enter it:
docker exec -it <appName> /bin/sh
0 0
- 最近的两个小项目,2:Python webapp的docker镜像
- 创建Web项目的Docker镜像
- docker下删除两个id相同的镜像
- 创建超小的golang应用Docker镜像
- Docker多步构建更小的Java镜像
- Docker多步构建更小的Java镜像
- 通过Jenkins构建maven项目的Docker镜像
- Docker 制作自己的WEB镜像,并运行项目
- 分享centos+python+keras+tensorflow环境的docker镜像
- docker 7 打包 docker 的镜像
- Docker的实例小教程--Dockerfile制作镜像(2)
- docker镜像的创建
- docker镜像的导出
- Docker:镜像的迁移
- 自制的Docker镜像
- Docker的镜像简介
- docker镜像的问题
- docker 镜像的迁移
- 文件上传异步
- Yii2 常用配置和概念小记
- Linux下svn服务端的安装与配置
- 数据分片路由抽象模型
- 医疗APP功能解析一微医
- 最近的两个小项目,2:Python webapp的docker镜像
- 在Linux直接运行安卓程序
- 练习三1001
- 圆形TextView的实现
- 山东省第五届ACM省赛题——Painting Cottages(求点集的划分)
- 啊哈!算法—冒泡排序
- 正则表达式知识详解之贪婪模式和非贪婪模式 (java版示例)
- Spring 实践:AOP
- 解读开源中国oschina App(thanatosx版)引导贴