Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLASK_APP: not found #13

Open
saravanand78 opened this issue Oct 16, 2021 · 0 comments
Open

FLASK_APP: not found #13

saravanand78 opened this issue Oct 16, 2021 · 0 comments

Comments

@saravanand78
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant