【发布时间】:2020-05-27 05:53:42
【问题描述】:
这里可能有一个相当简单的答案,但是...
我正在尝试使用这个容器:https://hub.docker.com/r/gboeing/osmnx,以便轻松处理一些复杂的依赖关系。在从 continuum/anaconda 容器构建 docker 映像时,我遇到了各种 conda 依赖关系问题。
所以,我想在这个容器中公开一个端口并运行一个 Django 服务器。
我手动安装了 Django 并在容器内运行服务器。但是,我无法连接到 localhost,http://127.0.0.1:8000/。
(base) root@91805d36444c:/server# python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
May 27, 2020 - 05:31:45
Django version 3.0.6, using settings 'server.settings'
Starting development server at http://127.0.0.1:8000/
在浏览器中导航到http://127.0.0.1:8000/,无法访问。
可能的相关信息:
Docker version 19.03.9, build 9d988398e7- 我的操作系统是
Description: Ubuntu 18.04.4 LTS - 使用类似https://docs.docker.com/compose/django/ 的内容访问http://127.0.0.1:8000/ 没有问题
【问题讨论】:
-
不要在
gboeing/osmnx容器中运行它,您应该在这里遇到 anaconda 遇到的错误。也许也可以分享我们可以提供帮助的需求文件。
标签: python django docker osmnx