Razip
Razip

Reputation: 155

Phalcon-compose & Docker Toolbox web-server sees no files

My OS is Windows 7 and I'm using Docker Toolbox. I was following this tutorial, but then I got stuck when trying to open the web-page because my browser said it couldn't establish a connection.

variables.env (the rest is default):

# 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

hosts:

# 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

Then I found that there's a program called Kitematic that had been installed with Docker Tools so I opened it and saw all of my containers. I went to "wildlife_app_1" which is my web-server and saw a console with a warning in it:

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

There was a button called "exec" which allows to open a container's terminal so I opened it and I found that there actually wasn't such a directory as "public" in "/project".

Does anyone know how to fix that? Thanks in advance!

Upvotes: 1

Views: 270

Answers (2)

Razip
Razip

Reputation: 155

The following is rather a workaround than a solution, but anyway. I've changed the "." dots in the config file with the absolute path to the project directory from.

Before:

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

After:

  - 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

And it works now.

Upvotes: 1

serghei
serghei

Reputation: 3381

You have to use your host (local machine IP) in the hosts file eg. 192.168.1.129. Note: here the 192.168.1.129 IP address just for example.

You can often find the information quickly using the Command Prompt or Terminal. In Windows, you can open the Start menu, search for Command Prompt, and press Enter. Then type ipconfig in the Command Prompt that appears and press Enter—you’ll get to what you’re looking for in no time.

enter image description here

Upvotes: 1

Related Questions