Skip to content

Instantly share code, notes, and snippets.

@nickstenning
Created June 6, 2013 17:56
Show Gist options
  • Save nickstenning/5723505 to your computer and use it in GitHub Desktop.
Save nickstenning/5723505 to your computer and use it in GitHub Desktop.
A "hello world" application with Dockerfile
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
app.run(host='0.0.0.0')
# DOCKER-VERSION 0.4.0
from ubuntu:12.04
run echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
run apt-get -y update
run apt-get -y install python python-flask
run mkdir -p /srv/fooapp
add . /srv/fooapp
expose 5000
cmd ["python", "/srv/fooapp/app.py"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment