Skip to content

Instantly share code, notes, and snippets.

@ToshY
Forked from rhamedy/Dockerfile
Created September 17, 2022 17:58

Revisions

  1. @rhamedy rhamedy created this gist Apr 18, 2021.
    6 changes: 6 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    FROM python:3.8-slim-buster
    COPY . /app
    WORKDIR /app
    RUN pip install -r requirements.txt
    ENTRYPOINT [ "python" ]
    CMD [ "app.py" ]
    13 changes: 13 additions & 0 deletions app.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    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)
    1 change: 1 addition & 0 deletions requirements.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Flask==0.12