simple-webapp-flask
simple-webapp-flask copied to clipboard
pip install not working
Hi,
The old docker file is not working getting error -> I have updated the docker file (Thank You for your docker course)
FROM ubuntu RUN apt-get update && apt-get install -y python3 python3-pip RUN pip install Flask COPY app.py /opt/ ENTRYPOINT FLASK_APP=/opt/app.py flask run --host=0.0.0.0 --port=8080
commit details: 351e861cc84cfef69a31eb6cd40c1f76b2940eaa
New Docker file it's working 👍
This is what made it work for me today. I also needed to map top port 5000 on the backend but not sure why.
FROM ubuntu
RUN apt-get update
RUN apt-get install -y python2 python-pip
RUN pip2 install flask
COPY app.py /opt/app.py
ENTRYPOINT FLASK_APP=/opt/app.py flask run --host=0.0.0.0
My app.py file looks like this
import os
from flask import Flask
app = Flask(__name__)
@app.route("/")
def main():
return "Welcome!"
@app.route('/how are you')
def hello():
return 'I am good, how about you?'
if __name__ == "__main__":
app.run(host="0.0.0.0", port=8080)