Blog 2019/8/16
<- previous | index | next ->
cobbled together from a few tutorials online.
Just run make
.
Blog 2019/8/16
<- previous | index | next ->
cobbled together from a few tutorials online.
Just run make
.
FROM python:3-alpine | |
WORKDIR /opt/hello-flask | |
COPY requirements.txt ./ | |
RUN pip install --no-cache-dir -r requirements.txt | |
COPY . . | |
CMD ["python", "./hello-flask.py"] |
#!/usr/bin/env python | |
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_flask(): | |
return "Hello, Flask!" | |
if __name__ == '__main__': | |
# enable debug mode by setting the env var FLASK_ENV=development | |
app.run(host='0.0.0.0', port=80) |
run: build | |
docker run -it --rm -p 5000:80 -e FLASK_ENV='development' hello-flask | |
build: | |
docker build -t hello-flask . |
Flask==1.1.1 |