first code release: Flask app

This commit is contained in:
bisco 2023-11-05 19:22:48 +01:00
parent 89f9bde1ba
commit 69c307180f
2 changed files with 25 additions and 0 deletions

12
app/Dockerfile Normal file
View File

@ -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"]

13
app/app.py Normal file
View File

@ -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)