Skip to content

Instantly share code, notes, and snippets.

@proppy
Last active January 2, 2016 18:39
Show Gist options
  • Save proppy/8344961 to your computer and use it in GitHub Desktop.
Save proppy/8344961 to your computer and use it in GitHub Desktop.
Dockerfile for minimal flask app
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
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run(host='0.0.0.0')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment