【问题标题】:heroku error while "There's nothing here, yet."heroku 错误,而“这里什么都没有。”
【发布时间】:2022-01-24 22:20:36
【问题描述】:

我已经使用 Docker 在 Heroku 上部署了简单的烧瓶应用程序,并使用 heroku-simple-flask-prod.herokuapp.com 进行访问。但是,我得到“这里什么都没有。构建一些惊人的东西”错误页面。据我所知,使用 herokudns.com 时 DNS 设置不正确会发生这种情况。但在这里我使用 herokuapp.com 链接。在任何情况下都应该可以访问。那么这里有什么问题呢?

烧瓶代码:

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)

我的 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

我的 heroku.yml

build:
  docker:
    web: Dockerfile
run:
  web: python3 app.py

【问题讨论】:

    标签: python docker flask heroku


    【解决方案1】:

    刚刚发生在我身上。

    使用 Heroku CLI 到 delete the app,然后重新创建它并推送到 heroku。

    【讨论】:

      猜你喜欢
      • 2020-09-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-09
      • 2020-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多