A simple web app using Flask
pip install flask
From shell where which you will be running app, set envionment variable to test, verify you get this when execute env
or printenv
export APP_COLOR=red
python app.py
docker build -t hello-flask:v1 .
It runs in background mode, you can access from http://localhost:5000
docker run -d -p 5000:5000 --name hello-flask hello-flask:v1
-
To pass env variable
APP_COLOR
to docker container, New site is available here http://localhost:5001docker run -d -p 5001:5000 --name hello-flask-env --env APP_COLOR=blue hello-flask:v1