Last active
June 17, 2018 00:57
-
-
Save elo80ka/3f49eeb3d5beab0f37c1bb369cd6700e to your computer and use it in GitHub Desktop.
Source code and Dockerfile for demo app from the Lagos Software Engineering Group container talk.
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 http import server | |
| addr = ('0.0.0.0', 8008) | |
| class handler(server.BaseHTTPRequestHandler): | |
| def do_GET(self): | |
| self.send_response(200) | |
| self.send_header('Content-Type', 'text/plain') | |
| self.end_headers() | |
| self.wfile.write(b'Hello, container world!') | |
| try: | |
| print('Listening on http://%s:%s...' % addr) | |
| my_server = server.HTTPServer(addr, handler, True) | |
| my_server.serve_forever() | |
| except KeyboardInterrupt: | |
| my_server.socket.close() |
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 python:3.6.4-alpine3.7 | |
| WORKDIR /app | |
| ADD code.py /app | |
| CMD ["python", "/app/code.py"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment