我已经构建了一个烧瓶app图像,可以在本地使用。但是当我将其部署到Web应用程序时,无法加载该网站。我已经关注了使用azure-cli进行部署的文档。还尝试通过azure portal进行部署。通过azure-cli,找不到代码,站点是初始页面。通过门户网站,网站始终重新加载,无法加载。我不知道问题出在哪里。
FROM ubuntu:16.04
ENV HOME /root
RUN apt-get update && apt-get -y upgrade
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
git \
bash \
curl \
lsb-release
RUN apt-get update && apt-get -y install apt-transport-https
RUN pip3 install pip --upgrade
# RUN ["/bin/bash","-c", "AZ_REPO=$(lsb_release -cs)"]
# to-do: 下一步读取不了这一步的环境变量,先写 xenial 应急吧
RUN ["/bin/bash","-c", "echo 'deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ xenial main' | \
tee /etc/apt/sources.list.d/azure-cli.list"]
RUN ["/bin/bash", "-c","apt-key adv --keyserver packages.microsoft.com --recv-keys 52E16F86FEE04B979B07E28DB02C46DF417A0893"]
RUN ["/bin/bash", "-c","curl -L https://packages.microsoft.com/keys/microsoft.asc | apt-key add -"]
RUN apt-get update && apt-get install azure-cli
RUN az aks install-cli
ADD . /src
WORKDIR /src
RUN pip3 install -r requirements.txt
# CMD ["python3", "upload.py"]
CMD ["gunicorn", "upload:app", "-c", "gunicorn.conf.py"]
:
upload.py
if __name__ == '__main__':
app.run()
的结尾:
gunicorn.conf.py
workers = 5
worker_class = "gevent"
bind = "0.0.0.0:80"
:
tb_data_20180502104923