【问题标题】:Phalcon-compose & Docker Toolbox web-server sees no filesPhalcon-compose & Docker Toolbox web-server 看不到文件
【发布时间】:2017-07-02 10:42:05
【问题描述】:

我的操作系统是 Windows 7,我使用的是 Docker Toolbox。我正在关注this 教程,但是当我尝试打开网页时卡住了,因为我的浏览器说它无法建立连接。

variables.env(其余为默认):

# Application
WEB_DOCUMENT_ROOT=/project/public
WEB_ALIAS_DOMAIN=localhost
APPLICATION_CACHE=/project/cache
APPLICATION_LOGS=/project/logs
# production | development | staging | testing
APPLICATION_ENV=development

主持人:

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost
127.0.0.1       localhost

然后我发现有一个名为 Kitematic 的程序已经安装了 Docker Tools,所以我打开它并看到了我所有的容器。我去了“wildlife_app_1”,这是我的网络服务器,看到一个带有警告的控制台:

[WARNING] WEB_DOCUMENT_ROOT does not exists with path "/project/public"!

有一个名为“exec”的按钮可以打开容器的终端,所以我打开它,发现“/project”中实际上没有“public”这样的目录。

有谁知道如何解决这个问题?提前致谢!

【问题讨论】:

    标签: docker docker-compose phalcon


    【解决方案1】:

    您必须在 hosts 文件中使用您的主机(本地计算机 IP),例如。 192.168.1.129。注意:这里以192.168.1.129 IP 地址为例。

    您通常可以使用命令提示符或终端快速找到信息。在 Windows 中,您可以打开“开始”菜单,搜索命令提示符,然后按 Enter。然后在出现的命令提示符中输入ipconfig 并按 Enter 键——您很快就会找到您要查找的内容。

    【讨论】:

    • 感谢您,Kitematic 说该网站也位于192.168.99.100。现在的问题是文件和目录没有从我的项目文件夹复制到容器的文件夹中,因此服务器可以找到它们并工作。
    • 尝试使用docker-compose up ...在没有Kitematic的情况下启动应用程序
    • 我没有使用 Kitematic 启动我的应用程序,而是从“docker-compose up -d”开始,因为它是在我遵循的手册中编写的。
    【解决方案2】:

    以下是一种解决方法而不是解决方案,但无论如何。我已经改变了“。”配置文件中的点以及项目目录的绝对路径。

    之前:

      - ./application:/project
      - ./cache:/project/cache
      - ./logs:/project/logs
    

    之后:

      - C:/Users/Dmitriy/Desktop/projects/Wildlife/application:/project
      - C:/Users/Dmitriy/Desktop/projects/Wildlife/cache:/project/cache
      - C:/Users/Dmitriy/Desktop/projects/Wildlife/logs:/project/logs
    

    现在可以使用了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-31
      • 1970-01-01
      • 2022-01-14
      • 1970-01-01
      • 1970-01-01
      • 2022-12-04
      相关资源
      最近更新 更多