Skip to content

Instantly share code, notes, and snippets.

@rhamedy
Created April 18, 2021 21:56
Show Gist options
  • Save rhamedy/ed9b2e9893a46e69ed818c7bb6e32c7b to your computer and use it in GitHub Desktop.
Save rhamedy/ed9b2e9893a46e69ed818c7bb6e32c7b to your computer and use it in GitHub Desktop.
Sample Flask App - Ping Service
from flask import Flask
app = Flask(__name__)
@app.route('/')
def pong_service():
return 'Hello, I am pong service!'
@app.route('/pong')
def do_pong():
return 'Pong'
if __name__ == "__main__":
app.run(host ='0.0.0.0', port = 5001, debug = True)
FROM python:3.8-slim-buster
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
ENTRYPOINT [ "python" ]
CMD [ "app.py" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment