Skip to content

Instantly share code, notes, and snippets.

@judepereira
Last active June 26, 2019 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save judepereira/d52ca873731b84e1bfa2f12768bd2be7 to your computer and use it in GitHub Desktop.
Save judepereira/d52ca873731b84e1bfa2f12768bd2be7 to your computer and use it in GitHub Desktop.

Dockerfile:

FROM        python:3.7-alpine

RUN         mkdir /app
ADD         requirements.txt /app
RUN         pip install -r /app/requirements.txt
ADD         app.py /app

ENTRYPOINT  ["python", "/app/app.py"]

microservice.yaml:

omg: 1
info:
  version: 1.0.1
  title: hello world
  description: hello world
lifecycle:
  startup:
    command: ['python', 'app.py']
actions:
  hello:
    http:
      port: 8000
      path: /
      method: get

requirements.txt:

Flask

app.py

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', port=8000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment