simple-webapp-flask icon indicating copy to clipboard operation
simple-webapp-flask copied to clipboard

pip install not working

Open dishoneprabu opened this issue 2 years ago • 3 comments

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

dishoneprabu avatar Jan 09 '23 20:01 dishoneprabu

commit details: 351e861cc84cfef69a31eb6cd40c1f76b2940eaa

dishoneprabu avatar Jan 09 '23 20:01 dishoneprabu

New Docker file it's working 👍 Screenshot (238)

akhilesh-patel avatar Apr 05 '23 13:04 akhilesh-patel

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)

wnadim92 avatar Jan 20 '24 19:01 wnadim92