因此,实际上,我想使用Docker容器运行Pygame应用程序。但是,当我运行Docker并单击终端上的链接时,它将打开一个选项卡,并说:“网页at http://0.0.0.0:8000/ 可能暂时下降,或者它可能已永久移动到新的网址。”
这是aliens.py github链接:
在aliens.py文件中,我在其中添加了一些代码:
from fastapi import FastAPI
import uvicorn
app = FastAPI()
我
if __name__ == '__main__': uvicorn.run(app, port=8000, host="0.0.0.0")
创建的Dockerfile文件的代码
Python FROM:3.10
WORKDIR /fastapi-app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY ./app ./app
CMD["python", "./app/aliens.py"]
以及 主机的IP地址?
so actually, i want to run a pygame application using docker container. however, when i run the docker and click the link at the terminal, it opens a tab and it says : "The webpage at http://0.0.0.0:8000/ might be temporarily down or it may have moved permanently to a new web address."
here's the aliens.py github link: https://github.com/xamox/pygame/blob/master/examples/aliens.py
in the aliens.py file, I added some code into it:
from fastapi import FastAPI
import uvicorn
app = FastAPI()
and
if __name__ == '__main__': uvicorn.run(app, port=8000, host="0.0.0.0")
and for the code of the Dockerfile file that I have created:
Python FROM:3.10
WORKDIR /fastapi-app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY ./app ./app
CMD["python", "./app/aliens.py"]
Is the problem is in the IP address of the host?
发布评论
评论(1)
dockerfile
aliens.py
没有Aliens-Code的
测试http:// localhost/docs
Dockerfile
aliens.py
Testing without aliens-code
http://localhost/docs
