1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-05-13 02:48:10 +00:00

Alpine-Traefik (#4412)

This commit is contained in:
CanbiZ 2025-05-12 20:02:53 +02:00 committed by GitHub
parent 61b09e926a
commit dfbb1a8035
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 108 additions and 0 deletions

41
ct/alpine-traefik.sh Normal file
View File

@ -0,0 +1,41 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2025 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://alpinelinux.org/
APP="Alpine-Traefik"
var_tags="${var_tags:-os;alpine}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-512}"
var_disk="${var_disk:-1}"
var_os="${var_os:-alpine}"
var_version="${var_version:-3.21}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
msg_info "Updating Alpine Packages"
$STD apk -U upgrade
msg_ok "Updated Alpine Packages"
msg_info "Upgrading traefik from edge"
$STD apk add traefik --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
msg_ok "Upgraded traefik"
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} WebUI Access (if configured) - using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8080/dashboard${CL}"

View File

@ -25,6 +25,17 @@
"os": "debian",
"version": "12"
}
},
{
"type": "alpine",
"script": "ct/alpine-traefik.sh",
"resources": {
"cpu": 1,
"ram": 512,
"hdd": 1,
"os": "alpine",
"version": "3.21"
}
}
],
"default_credentials": {

View File

@ -0,0 +1,56 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2025 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apk add ca-certificates
$STD update-ca-certificates
msg_ok "Installed Dependencies"
msg_info "Installing Traefik"
$STD apk add traefik --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
msg_ok "Installed Traefik"
read -p "Enable Traefik WebUI (Port 8080)? [y/N]: " enable_webui
if [[ "$enable_webui" =~ ^[Yy]$ ]]; then
msg_info "Configuring Traefik WebUI"
mkdir -p /etc/traefik/config
cat <<EOF >/etc/traefik/traefik.yml
entryPoints:
web:
address: ":80"
traefik:
address: ":8080"
api:
dashboard: true
insecure: true
log:
level: INFO
providers:
file:
directory: /etc/traefik/config
watch: true
EOF
msg_ok "Configured Traefik WebUI"
fi
msg_info "Enabling and starting Traefik service"
$STD rc-update add traefik default
$STD rc-service traefik start
msg_ok "Traefik service started"
motd_ssh
customize