azure-search-openai-demo 应用程序的 Dockerfile

问题描述 投票:0回答:1

我正在尝试使用基于 Dockerfile

 的以下 
app/start.sh
 Dockerise 
azure-search-openai-demo

应用程序

# frontend-build
FROM node:16-buster AS frontend-build

COPY frontend /app/frontend

WORKDIR /app/frontend

RUN rm -r node_modules

RUN npm install

RUN npm run build

# backend build
FROM python:3.11 AS backend-build

COPY backend /app/backend

WORKDIR /app/backend

RUN pip install -r requirements.txt

EXPOSE 5000

CMD ["python", "-m", "quart", "--app", "main:app", "run", "--port", "5000", "--host", "localhost", "--reload"]

Docker 镜像已构建,但当我启动它并尝试访问网络时,我看到了

http://localhost:5000/
如有任何帮助,我们将不胜感激。

python docker dockerfile quart
1个回答
0
投票
您需要将
    HTTP ERROR 403
  • 中的
    localhost
    更改为
    0.0.0.0
    。请参阅
    这篇文章
    了解原因。 使用
  • CMD
  • 运行容器。
    
    
  • -p 5000:5000
🗎
├── backend │   ├── main.py │   └── requirements.txt └── Dockerfile

main.py

🗎
from quart import Quart, render_template, websocket app = Quart(__name__) @app.route("/") async def hello(): return "Hello, World!" if __name__ == "__main__": app.run()

requirements.txt

🗎
Quart==0.19.4

Dockerfile

下面的屏幕截图显示了容器正在运行以及在 http://localhost:5000 上访问的演示页面。

© www.soinside.com 2019 - 2024. All rights reserved.