Skip to content

Instantly share code, notes, and snippets.

@timothyis
Last active August 1, 2018 16:48
Show Gist options
  • Save timothyis/1484d859b2ec2a11966bfafeedd9a4f2 to your computer and use it in GitHub Desktop.
Save timothyis/1484d859b2ec2a11966bfafeedd9a4f2 to your computer and use it in GitHub Desktop.
Python starter application using Docker and deployed on Now (https://zeit.co/now)

An example app, deployed on Now, built and configured to use Python using a Dockerfile.

FROM python:3-alpine
WORKDIR /usr/src
COPY . .
CMD ["python", "main.py"]
from http.server import BaseHTTPRequestHandler,HTTPServer
class myHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.end_headers()
self.wfile.write(b'Hello Python!')
server = HTTPServer(('', 3000), myHandler)
server.serve_forever()
{
"type": "docker",
"features": {
"cloud": "v2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment