Skip to content
This repository has been archived by the owner on Nov 5, 2020. It is now read-only.

docker-compose community site can't reached #16

Open
BhagiLimbu opened this issue May 3, 2019 · 10 comments
Open

docker-compose community site can't reached #16

BhagiLimbu opened this issue May 3, 2019 · 10 comments

Comments

@BhagiLimbu
Copy link

Hi,

I download community edition OroCRM 3.1 on my local machine and change a folder name democrm. Then, I clone the environment on local machine. And I follow the instruction as mention here : https://github.com/oroinc/environment/blob/master/doc/ADVANCED_USAGE.md

I use git bash terminal for command line:
export ORO_APP=/c/phpworkspace/democrm
export SYMFONY_ENV=dev

docker-compose -p democrm -f /c/phpworkspace/environment-master-oro/php71_nginx_mysql_full_ce.yml up -d
Creating network "democrm_default" with the default driver
Creating democrm_mail_1 ... done
Creating democrm_data_1 ... done
Creating democrm_composer_1 ... done
Creating democrm_database_1 ... done
Creating democrm_php_1 ... done
Creating democrm_consumer_1 ... done
Creating democrm_websocket_1 ... done
Creating democrm_cron_1 ... done
Creating democrm_webserver_1 ... done

The docker-compose run successfully; however, when I type http://webserver.democrm.docker/ on browser its display : This site can’t be reached

I wonder which steps went wrong or missed, appreciate if you could share your experience to sorted out the issue.

@anyt anyt added the question label May 6, 2019
@anyt
Copy link
Contributor

anyt commented May 6, 2019

Looks like you haven't started the dns-gen container and haven't set up resolvconf.
See https://github.com/oroinc/environment/blob/e7679d576b97afc94b506bc67382e1a58c49d65e/doc/INSTALL.md
Starting from step 6.

@BhagiLimbu
Copy link
Author

Thanks for your response, I use git bash on windows machine. I follow the step 6, but the bash command return won't recognize the "IP" command. The instructions commands on INSTALL.md can't run on windows git bash command. Questions:

  1. What will be the IP address for DOCKER0_IP, is it container IP address? if yes which container IP address should I assign ?
  2. Do you have other solution which can set up dns-gen container from windows git bash?

@anyt
Copy link
Contributor

anyt commented May 6, 2019

This repository is not ready for Windows, it's prepared for the Linux and Mac only.

@BhagiLimbu
Copy link
Author

Thank you for your quick response, let me try on Mac later today and back to you.

@BhagiLimbu
Copy link
Author

BhagiLimbu commented May 11, 2019

I tried in Mac, found similar issue. Here's my running containers :

  • oroinc/nginx:1.11-alpine "/entrypoint.sh ngin…" 443/tcp, 0.0.0.0:32772->80/tcp sokpacrm_webserver_1
  • oroinc/consumer:7.1-xenial "/entrypoint.sh /bin…" sokpacrm_consumer_1
  • oroinc/websocket:7.1-xenial "/entrypoint.sh /bin…" 0.0.0.0:32771->8080/tcp sokpacrm_websocket_1
  • oroinc/cron:7.1-fpm-xenial "/entrypoint.sh /bin…" sokpacrm_cron_1
  • oroinc/php:7.1-fpm-xenial "/entrypoint.sh php-…" sokpacrm_php_1
  • oroinc/mysql:5.5-empty "docker-entrypoint.s…" 0.0.0.0:32770->3306/tcp sokpacrm_database_1
  • mailhog/MailHog "MailHog" 25/tcp, 80/tcp, 8025/tcp, 0.0.0.0:32769->1025/tcp, 0.0.0.0:32768->1080/tcp
  • oroinc/data:latest "/bin/sh -c 'while :…" okpacrm_data_1
  • oroinc/docker-dns-gen "governator -D" 0.0.0.0:53->53/udp dns-gen

The IP addresses are displaying - 0.0.0.0. In my Mac resolv.conf files are reading following IP address:
/etc/resolv.conf and /var/run/resolv.conf
nameserver 8.8.8.8
nameserver 114.114.114.114

Do you suggest I should update 0.0.0.0 on resolv.conf?

@anyt
Copy link
Contributor

anyt commented May 15, 2019

0.0.0.0:53->53/udp

that means the 53 port is bound to the localhost:53.

Do you suggest I should update 0.0.0.0 on resolv.conf?

use 127.0.0.1

@BhagiLimbu
Copy link
Author

BhagiLimbu commented May 15, 2019

Thanks Andrey, will let you know after update : nameserver 127.0.0.1 on resolve.conf file.

@BhagiLimbu
Copy link
Author

I add 127.0.0.1 on System Preferences > Network > Advanced > DNS and run command to verify docker dns : host dns-gen.docker it return:
dns-gen.docker has address 172.17.0.2

Then type url : http://webserver.sokpacrm.docker/ on browser, its keeping connecting webserver for a while and display message : webserver.sokpacrm.docker took too long to respond.

And type command on terminal : nslookup webserver.sokpacrm.docker
returns:
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: webserver.sokpacrm.docker
Address: 172.18.0.10

When I ping 172.18.0.10 and webserver.sokpacrm.docker, it's display a message - Request timeout for icmp_seq 0

Any suggestion?

@BhagiLimbu
Copy link
Author

BhagiLimbu commented May 22, 2019

I wonder instruction mention for Mac installation relevant with Desktop for Mac? Local machine Mac for docker is: Docker version 18.09.2, build 6247962. Is it necessary to run dns-gen on desktop for Mac?

@anyt
Copy link
Contributor

anyt commented May 30, 2019

Sorry for a long response. Docker is not so popular in our team and looks like no one uses this Docker setup on a Mac because it is slow and in another hand, it's easy to configure fast local environment on a Mac with brew that is a few times faster than Docker.

I had some time to investigate an issue locally.
dns-gen can be used on Mac also, but it is required only when you want to manage multiple applications locally.

When you work with the single instance, you can simplify the flow and map ports from the docker containers to the localhost. You have to expose 8080 port from websocket and 80 port from the web server.
These ports are already exposed to some automatically selected ports.
In your example
oroinc/nginx:1.11-alpine "/entrypoint.sh ngin…" 443/tcp, 0.0.0.0:32772->80/tcp sokpacrm_webserver_1 means that you can access nginx at 127.0.0.1:32772
oroinc/websocket:7.1-xenial "/entrypoint.sh /bin…" 0.0.0.0:32771->8080/tcp - websocket server at 127.0.0.1:32771
0.0.0.0 means localhost or 127.0.0.1
And this works without dns-gen.

At the same time, you can force mappings for a port in localhost with the docker-compose to use 80 for web server and 8080 for WebSocket, so the website will be accessed from http://localhost.

And also you can map a custom domain to the localhost by editing /etc/hosts file in a host machine.

I was not able to setup dns-gen locally on mac yet. Will let you know when finding how to deal with it.

The instruction in this repo says only how to start the containers with ready environment, and how to run tests on them. So when you open the port in localhost directly or the mapped with dns gen domain you will see just a page with PHP error. It means the docker containers started properly, at least nginx and PHP, but the application is not ready.
To start using an application you have to add env map to the composer.json, by following this example https://github.com/oroinc/crm-application/blob/master/dev.json#L115-L143

Then install it first by following this instruction the Install OroCRM Community Edition Application section.

To run commands inside a container you can use standard docker approach, like

docker-compose -p democrm -f /c/phpworkspace/environment-master-oro/php71_nginx_mysql_full_ce.yml run composer install --prefer-dist --no-suggest --no-interaction --ignore-platform-reqs --optimize-autoloader
docker-compose -p democrm -f /c/phpworkspace/environment-master-oro/php71_nginx_mysql_full_ce.yml run php bin/console oro:install --no-interaction --skip-assets --skip-translations --user-name=admin --user-email=admin@example.com --user-firstname=John --user-lastname=Doe --user-password=admin --sample-data=n --organization-name=Oro --application-url='http://localhost/' --timeout=0

I noticed that our docker-containers affected with this bug oroinc/platform#912 and it is required to patch the vendors before an installation. It will be fixed in the next patch release - 3.1.8.

I'm working on a complete step-by-step instruction, as the current one is not really useable for newcomers. Will update an issue when it's finished.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants