feat: add support for routing an app to a specified host:port

This is useful when there is a service not managed by Dokku but should be exposed via the Dokku routing layer. As an example, some binaries (consul, nomad, vault) expose web uis, and are traditionally run on the host directly vs in a container.

Closes #4665
This commit is contained in:
Jose Diaz-Gonzalez
2021-08-06 01:29:25 -04:00
parent afd64c3e04
commit 9ecfa843f0
18 changed files with 298 additions and 7 deletions

View File

@@ -0,0 +1,52 @@
#!/usr/bin/env bats
load test_helper
setup() {
global_setup
create_app
}
teardown() {
destroy_app
global_teardown
}
# covers https://github.com/dokku/dokku/issues/4665
@test "(proxied-app) default" {
run /bin/bash -c "dokku builder:set $TEST_APP selected null"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku config:set $TEST_APP DOKKU_SCHEDULER=null"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku network:set $TEST_APP static-web-listener 127.0.0.1:8080"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku proxy:ports-set $TEST_APP http:80:8080"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku domains:set $TEST_APP $TEST_APP.dokku.me"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku proxy:build-config $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku nginx:show-config $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
assert_output_contains "server 127.0.0.1:8080;"
}