Esercitazione con Docker compose
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=True)
file di requirements.txt
flask
Dockerfile
FROM python
COPY . /app/
WORKDIR /app
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 5000
CMD ["python", "main.py"]
Utilizzare il docker compose.
quindi creare un file nella giusta estensione e caricarlo con i comandi visti in precedenza
PreviousDocker Compose vs DockerfileNextHands-on Machine Learning With Scikit-learn, Keras, and Tensorflow: Concepts, Tools, and Techniques
Last updated