53
loading...
This website collects cookies to deliver better user experience
\-- dockerExample
|-- app.py
|-- Dockerfile
|-- requirements.txt
\-- templates
|-- index.html
from flask import Flask,render_template
app=Flask(__name__)
@app.route('/')
def home():
return render_template('index.html')
if __name__==('__main__'):
app.run(debug=True)
<!DOCTYPE html>
<html>
<head>
<title>Getting started with Docker</title>
</head>
<body>
<p>This is my Dockerfile</p>
</body>
FROM python:3.9.6
COPY . /doc
COPY ./requirements.txt /doc/requirements.txt
WORKDIR /doc
EXPOSE 5000:5000
RUN pip install -r requirements.txt
CMD ["python","app.py"]
docker image build -t docker_example .
docker run -p 5000:5000 docker_example