first code release: Flask app
This commit is contained in:
parent
89f9bde1ba
commit
69c307180f
12
app/Dockerfile
Normal file
12
app/Dockerfile
Normal 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
13
app/app.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user