Last active
January 2, 2016 18:39
-
-
Save proppy/8344961 to your computer and use it in GitHub Desktop.
Dockerfile for minimal flask app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu | |
RUN echo 'deb http://archive.ubuntu.com/ubuntu precise universe' | tee -a /etc/apt/sources.list | |
RUN apt-get update | |
RUN apt-get install -y python python-virtualenv | |
RUN mkdir -p /usr/src/app | |
ADD requirements.txt /usr/src/app/ | |
RUN virtualenv /usr/src/app/env | |
RUN /usr/src/app/env/bin/pip install -r /usr/src/app/requirements.txt | |
ADD . /usr/src/app | |
EXPOSE 5000 | |
ENTRYPOINT /usr/src/app/env/bin/python /usr/src/app/main.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
app = Flask(__name__) | |
@app.route("/") | |
def hello(): | |
return "Hello World!" | |
if __name__ == "__main__": | |
app.run(host='0.0.0.0') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Flask | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment