mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
This plugin uses a docker-compose based Caddy installation in conjunction with injected container labels to route requests. It only exposes the minimal necessary for routing traffic to docker containers. Users wishing to customize further labels may explore using the docker-options plugin to attach additional labels during the 'deploy' phase.
25 lines
738 B
Bash
Executable File
25 lines
738 B
Bash
Executable File
#!/usr/bin/env bash
|
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|
source "$PLUGIN_AVAILABLE_PATH/caddy-vhosts/internal-functions"
|
|
set -eo pipefail
|
|
[[ $DOKKU_TRACE ]] && set -x
|
|
|
|
trigger-caddy-vhosts-core-post-deploy() {
|
|
declare desc="caddy-vhosts core-post-deploy plugin trigger"
|
|
declare trigger="core-post-deploy"
|
|
declare APP="$1"
|
|
local tls_internal
|
|
|
|
if [[ "$(plugn trigger proxy-type "$APP")" != "caddy" ]]; then
|
|
return
|
|
fi
|
|
|
|
tls_internal="$(fn-caddy-tls-internal)"
|
|
dokku_log_info1 "Routing app via caddy"
|
|
if [[ "$tls_internal" == "true" ]]; then
|
|
dokku_log_warn "Warning: using caddy's internal, locally-trusted CA to produce certificates for this site"
|
|
fi
|
|
}
|
|
|
|
trigger-caddy-vhosts-core-post-deploy "$@"
|