You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting error message , FLASK_APP: not found when i try to execute command
docker run -p host port: container port docker image-name
Created a docker file using sample code provided in simple-webapp-flask application. Created an image, but when i execute the above command, get error message flask:app not found.
Below is the code snippet for app.py and docker file
app.py
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)
Dockerfile
FROM ubuntu
RUN apt-get update
RUN apt-get install -y python3 python3-pip
RUN pip install flask
COPY app.py /opt/app.py
ENTRYPOINT FLASK_APP = /opt/app.py flask run --host=0.0.0.0
could you pls advice
regards
Saravanan
The text was updated successfully, but these errors were encountered:
Hi Mumshad,
Getting error message , FLASK_APP: not found when i try to execute command
docker run -p host port: container port docker image-name
Created a docker file using sample code provided in simple-webapp-flask application. Created an image, but when i execute the above command, get error message flask:app not found.
Below is the code snippet for app.py and docker file
app.py
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)
Dockerfile
FROM ubuntu
RUN apt-get update
RUN apt-get install -y python3 python3-pip
RUN pip install flask
COPY app.py /opt/app.py
ENTRYPOINT FLASK_APP = /opt/app.py flask run --host=0.0.0.0
could you pls advice
regards
Saravanan
The text was updated successfully, but these errors were encountered: