From 69c307180f471f0bc2a13fc1df8e69418b51283d Mon Sep 17 00:00:00 2001 From: bisco Date: Sun, 5 Nov 2023 19:22:48 +0100 Subject: [PATCH] first code release: Flask app --- app/Dockerfile | 12 ++++++++++++ app/app.py | 13 +++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 app/Dockerfile create mode 100644 app/app.py diff --git a/app/Dockerfile b/app/Dockerfile new file mode 100644 index 0000000..7e0defa --- /dev/null +++ b/app/Dockerfile @@ -0,0 +1,12 @@ +FROM debian:12-slim +RUN apt update +RUN apt install -y \ + python3 \ + python3-pip \ + python3-flask +RUN mkdir -p /app +COPY app.py /app +WORKDIR /app +EXPOSE 5000 +ENTRYPOINT ["python3"] +CMD ["app.py"] \ No newline at end of file diff --git a/app/app.py b/app/app.py new file mode 100644 index 0000000..1b4a5dd --- /dev/null +++ b/app/app.py @@ -0,0 +1,13 @@ +from flask import Flask +import os + +app = Flask(__name__) + +@app.route("/") +def hello(): + return "CyberHackademy 2023 inside a docker container!" + + +if __name__ == "__main__": + port = int(os.environ.get("PORT", 5000)) + app.run(debug=True,host='0.0.0.0',port=port)