I have deployed simple flask app on Heroku with Docker and access using heroku-simple-flask-prod.herokuapp.com. However, I get "There's nothing here, yet. Build something amazing" error page. As I know, this happens with incorrect DNS setting while using herokudns.com. But here I use herokuapp.com link. Which should be accessible in any case. So what is wrong here?
Flask code:
import os
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return "welcome to the flask tutorials"
if __name__ == "__main__":
# below arrangment is done specially for Heroku
# https://stackoverflow.com/questions/17260338/deploying-flask-with-heroku
# Bind to PORT if defined, otherwise default to 5000.
port = int(os.environ.get('PORT', 5000))
app.run(host='0.0.0.0', port=port, debug = True)
My Dockerfile
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -y libxml2-dev xmlsec1
RUN apt-get install -y python3-pip python3-dev
RUN cd /usr/local/bin
RUN ln -s /usr/bin/python3 python
RUN pip3 --no-cache-dir install --upgrade pip
RUN rm -rf /var/lib/apt/lists/*
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
CMD python3 app.py
My heroku.yml
build:
docker:
web: Dockerfile
run:
web: python3 app.py