Created
April 18, 2021 21:56
-
-
Save rhamedy/ed9b2e9893a46e69ed818c7bb6e32c7b to your computer and use it in GitHub Desktop.
Sample Flask App - Ping Service
This file contains 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 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) |
This file contains 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.8-slim-buster | |
COPY . /app | |
WORKDIR /app | |
RUN pip install -r requirements.txt | |
ENTRYPOINT [ "python" ] | |
CMD [ "app.py" ] |
This file contains 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
Flask==0.12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment