ajout Dockerfile pour automatisation

This commit is contained in:
2023-03-19 23:34:01 +01:00
parent 16f6df29cc
commit bc26ed8889
8 changed files with 143 additions and 61 deletions
+13
View File
@@ -0,0 +1,13 @@
FROM python:3.8-slim-bullseye
WORKDIR /python-docker
COPY ./requirements.txt requirements.txt
RUN python3 -m pip install -r requirements.txt
COPY ./ .
EXPOSE 5000
CMD [ "python3", "-m" , "flask", "run", "--host=0.0.0.0"]
+8
View File
@@ -0,0 +1,8 @@
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_cloud():
return 'Hello Cloud!'
app.run(host='0.0.0.0')
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
sudo apt-get update
sudo apt-get install -yq docker.io
sudo docker build --network=host -t flaskapp .
sudo docker run -d -p 5000:5000 flaskapp:latest
#python3 -m pip install flask
#python3 app.py >> log.txt 2>&1 &
#nohup python3 -u ./app.py > output.log &
+1
View File
@@ -0,0 +1 @@
flask