ByteInternet / hypernode-docker

Fast and easy Docker for Magento development
https://community.hypernode.io/hypernode-docker
35 stars 8 forks source link

Changing domain from hypernode.hypernode.local to custom.hypernode.local #9

Closed AngelsDustz closed 6 years ago

AngelsDustz commented 6 years ago

Hello, is there a way to configure a custom URL? I've been looking around a bit but I can't figure it out. The hypernode-vagrant uses the folder name, it would be cool if this was a simple config item.

vdloo commented 6 years ago

you could do the same as the Vagrant does and set up a hostname to point to the Docker ip in the /etc/hosts on your host:

172.17.0.2 myshop.hypernode.local

And then set the Magento baseurl to http://myshop.hypernode.local for example. Then you should be able to access the shop hosted from the Docker on that (custom) URL.

AngelsDustz commented 6 years ago

Ah ofcourse I forgot to change the baseurl, makes sense.

Do you happen to know of a way to configure a docker container to have a static IP, this way it won't matter in what order we open the Dockers.

vdloo commented 6 years ago

that's possible, you can do that in Docker by manually managing the network or by using docker-compose or something to do it for you, see https://stackoverflow.com/a/35359185/4158804. but with dockers you might not really want to do that and use something dynamic like service discovery instead, it really depends on what your use-case is. if I had to set something up from scratch I'd probably use something like HashiCorp Consul to manage DNS by placing service checks on each Docker and then using something like dnsmasq to expose the service domains to the host.

AngelsDustz commented 6 years ago

Alright thank you!