Skip to content

Instantly share code, notes, and snippets.

Last active October 15, 2019 07:31
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save cellularmitosis/a5ffa13236548d36a2d89bef0725faef to your computer and use it in GitHub Desktop.
A Dockerized Flask "Hello, World!"

Blog 2019/8/16

<- previous | index | next ->

A Dockerized Flask "Hello, World!"

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", "./"]
#!/usr/bin/env python
from flask import Flask
app = Flask(__name__)
def hello_flask():
return "Hello, Flask!"
if __name__ == '__main__':
# enable debug mode by setting the env var FLASK_ENV=development'', port=80)
run: build
docker run -it --rm -p 5000:80 -e FLASK_ENV='development' hello-flask
docker build -t hello-flask .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment