-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Problem:
If you delete the VHOST file because you want to use port-based deployment (i.e. you're installing dokku in a VM), I expect the application to be deployed at http://hostname:port as per documentation.
But the current release deploys the app on http://app-name.hostname, ignoring the fact that no VHOST is set.
Steps to reproduce:
- Install dokku
- Remove /home/dokku/VHOST
- Deploy sample node-js-app
- In the git push output you'll see
=====> Application deployed:
http://node-js-app.<hostname>
Expected outcome:
=====> Application deployed:
http://<hostname>:<port>
Possible fix:
dokku url node-js-app returns the wrong hostname although the logic is correct.
The issue is in dokku nginx:build-config node-js-app as the logic to deploy on a port is executed only when the NO_VHOST variable is set (https://github.com/progrium/dokku/blob/master/plugins/nginx-vhosts/commands#L32)
Setting it manually works as expected:
root@combotest:~# env NO_VHOST=1 dokku nginx:build-config node-js-app
-----> NO_VHOST set, deleting node-js-app/VHOST
-----> NO_VHOST set, deleting nginx.conf
-----> NO_VHOST set, reloading nginx after nginx.conf deletion
I suspect this NO_VHOST variable should be set after deploy before calling nginx:build-config, but it isn't.
If you can point out which is the best place to set this variable, I can do a pull request myself.