fixing bugs

This commit is contained in:
Guillermo
2026-02-12 14:17:28 +00:00
parent 02d25ea19f
commit fe0c2de0d4

View File

@@ -1,6 +1,15 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
step() {
echo
echo "=================================================="
echo " 👉 $1"
echo "=================================================="
}
require_root() { require_root() {
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
echo "Este script debe ejecutarse como root (o con sudo)." echo "Este script debe ejecutarse como root (o con sudo)."
@@ -44,8 +53,7 @@ apt-get install -y \
containerd.io \ containerd.io \
docker-buildx-plugin \ docker-buildx-plugin \
docker-compose-plugin \ docker-compose-plugin \
git \ git
certbot
systemctl enable docker systemctl enable docker
systemctl start docker systemctl start docker
@@ -61,7 +69,7 @@ fi
# Creamos carpeta del proxy con docker compose. # Creamos carpeta del proxy con docker compose.
mkdir -p /opt/beyonxcx/traefik mkdir -p /opt/beyondcx/traefik
cat > /opt/beyondcx/traefik/docker-compose.yaml <<EOF cat > /opt/beyondcx/traefik/docker-compose.yaml <<EOF
services: services:
@@ -73,22 +81,32 @@ services:
- "443:443" - "443:443"
- "8080:8080" - "8080:8080"
environment: environment:
- DO_AUTH_TOKEN=${DO_AUTH_TOKEN} - DO_AUTH_TOKEN=\${DO_AUTH_TOKEN}
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
- ./config/traefik.yml:/etc/traefik/traefik.yaml:ro - ./config/traefik.yml:/etc/traefik/traefik.yaml:ro
- ./data/certs:/var/traefik/certs/:rw - ./data/certs:/var/traefik/certs/:rw
- ./config/conf:/etc/traefik/conf/:rw
- ./logs:/var/traefik/logs:rw
logging:
driver: "json-file"
options:
max-size: "100m"
networks: networks:
- frontend - frontend
restart: unless-stopped restart: unless-stopped
networks: networks:
frontend: frontend:
external: true external: true
EOF EOF
mkdir -p /opt/beyondcx/traefik/config mkdir -p /opt/beyondcx/traefik/config
mkdir -p /opt/beyondcx/traefik/logs
mkdir -p /opt/beyondcx/traefik/config/conf mkdir -p /opt/beyondcx/traefik/config/conf
echo "DO_AUTH_TOKEN=" > /opt/beyondcx/traefik/.env
cat > /opt/beyondcx/traefik/config/traefik.yml <<EOF cat > /opt/beyondcx/traefik/config/traefik.yml <<EOF
global: global:
checkNewVersion: false checkNewVersion: false
@@ -127,9 +145,13 @@ EOF
cd /opt/beyondcx/traefik cd /opt/beyondcx/traefik
docker network create frontend PROXY_NETWORK="frontend"
docker network ls if docker network inspect $PROXY_NETWORK > /dev/null 2>&1; then
echo "red de traefik existe"
else
docker network create $PROXY_NETWORK
fi
docker compose up -d docker compose up -d