项目
在 GitHub 查看
mmumshad/simple-webapp-flask
关于
Simple Flask based web application
学习与教育实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- -1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Simple Web Application
A minimal Python Flask web application used as the demo app in the KodeKloud Docker for Beginners course.
The app exposes two routes:
| Route | Response |
|---|---|
/ |
Welcome! |
/how-are-you |
I am good, how about you? |
Run manually (without Docker)
These steps assume a fresh machine.
Select an OS - Ubuntu
Update the package index:
sudo apt-get updateInstall Flask (this also pulls in Python 3):
sudo apt-get install -y python3-flaskSet the Flask app environment variable:
export FLASK_APP=app.pyStart the application:
flask run --host=0.0.0.0
Then open http://localhost:5000 and http://localhost:5000/how-are-you in a browser.
Run with Docker
git clone https://github.com/mmumshad/simple-webapp-flask.git
cd simple-webapp-flask
docker build -t simple-webapp-flask .
docker run -p 5000:5000 simple-webapp-flask
Then open http://localhost:5000 and http://localhost:5000/how-are-you in a browser.
The Dockerfile
FROM ubuntu
RUN apt-get update
RUN apt-get install -y python3-flask
COPY app.py /opt/app.py
ENV FLASK_APP=/opt/app.py
ENTRYPOINT ["flask", "run", "--host=0.0.0.0"]
Each instruction mirrors one of the manual steps above — making it easy to see how a Dockerfile is just an automated install script.
探索相关项目
加载中…