From 4fc681b2c49672b8b5ee850d566a86f1ec098fa1 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Tue, 10 Feb 2026 18:39:21 +0000 Subject: [PATCH 01/65] cambiado el path de instalacion, eliminado el nginx y con labels de traefik --- docker-compose.yml | 24 ++- docker-compose.yml.back | 51 +++++++ install_beyond.sh | 317 +++++++++++++++++++++------------------- 3 files changed, 225 insertions(+), 167 deletions(-) create mode 100644 docker-compose.yml.back diff --git a/docker-compose.yml b/docker-compose.yml index d7734af..68f876c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,21 +28,17 @@ services: - "4173" networks: - beyond-net - - nginx: - image: nginx:1.27-alpine - container_name: beyond-nginx + - frontend + labels: + - "traefik.enable=true" + - "treafik.http.routers.XXX-https.rule=Host(`XXX.mylab.k8s.org.es`)" + - "traefik.http.routers.XXX-https.entrypoints=websecure" + - "traefik.http.routers.XXX-https.tls=true" + - "traefik.http.routers.XXX-https.tls.certresolver=doresolv" + - "traefik.http.routers.XXX-https.service=XXX-service-scv" + - "traefik.http.services.XXX-service-scv.loadBalancer.server.port=4173" depends_on: - backend - - frontend - ports: - - "80:80" - - "443:443" - volumes: - - /etc/letsencrypt:/etc/letsencrypt:ro - - ./nginx/conf.d:/etc/nginx/conf.d:ro - networks: - - beyond-net volumes: cache-data: @@ -51,3 +47,5 @@ volumes: networks: beyond-net: driver: bridge + frontend: + external: true diff --git a/docker-compose.yml.back b/docker-compose.yml.back new file mode 100644 index 0000000..c2ee3e3 --- /dev/null +++ b/docker-compose.yml.back @@ -0,0 +1,51 @@ +version: "3.9" + +services: + backend: + build: + context: ./backend + container_name: beyond-backend + environment: + # credenciales del API (las mismas que usas ahora) + BASIC_AUTH_USERNAME: "beyond" + BASIC_AUTH_PASSWORD: "beyond2026" + CACHE_DIR: "/data/cache" + volumes: + - cache-data:/data/cache + expose: + - "8000" + networks: + - beyond-net + + frontend: + build: + context: ./frontend + args: + # el front compilará con este BASE_URL -> /api + VITE_API_BASE_URL: /api + container_name: beyond-frontend + expose: + - "4173" + networks: + - beyond-net + - frontend + labels: + - "traefik.enable=true" + - "treafik.http.routers.XXX-https.rule=Host('XXX.mylab.k8s.org.es')" + - "traefik.http.routers.XXX-https.entrypoints=websecure" + - "traefik.http.routers.XXX-https.tls=true" + - "traefik.http.routers.XXX-https.tls.certresolver=doresolv" + - "traefik.http.routers.XXX-https.service=XXX-service-scv" + - "traefik.http.services.XXX-service-scv.loadBalancer.server.port=4173" + depends_on: + - backend + +volumes: + cache-data: + driver: local + +networks: + beyond-net: + driver: bridge + frontend: + external: true diff --git a/install_beyond.sh b/install_beyond.sh index fa53ddc..c5bdc60 100644 --- a/install_beyond.sh +++ b/install_beyond.sh @@ -6,7 +6,7 @@ set -euo pipefail ############################################### # TODO: pon aquí la URL real de tu repo (sin credenciales) REPO_URL_DEFAULT="https://github.com/igferne/Beyond-Diagnosis.git" -INSTALL_DIR="/opt/beyonddiagnosis" +INSTALL_BASE="/home/garbelo/" ############################################### # UTILIDADES @@ -37,7 +37,8 @@ if [ -z "$DOMAIN" ]; then echo "El dominio no puede estar vacío." exit 1 fi - +SUBDOMAIN="$DOMAIN%%.*" +INSTALL_DIR=$INSTALL_BASE"/"$SUBDOMAIN read -rp "Email para Let's Encrypt (avisos de renovación): " EMAIL if [ -z "$EMAIL" ]; then echo "El email no puede estar vacío." @@ -66,30 +67,32 @@ read -rp "¿El repositorio es PRIVADO en GitHub y necesitas token? [s/N]: " IS_P IS_PRIVATE=${IS_PRIVATE:-N} GIT_CLONE_URL="$REPO_URL" -if [[ "$IS_PRIVATE" =~ ^[sS]$ ]]; then - echo "Introduce un Personal Access Token (PAT) de GitHub con permiso de lectura del repo." - read -rsp "GitHub PAT: " GITHUB_TOKEN - echo - if [ -z "$GITHUB_TOKEN" ]; then - echo "El token no puede estar vacío si el repo es privado." - exit 1 - fi - - # Construimos una URL del tipo: https://TOKEN@github.com/usuario/repo.git - if [[ "$REPO_URL" =~ ^https:// ]]; then - GIT_CLONE_URL="https://${GITHUB_TOKEN}@${REPO_URL#https://}" - else - echo "La URL del repositorio debe empezar por https:// para usar el token." - exit 1 - fi -fi - +#if [[ "$IS_PRIVATE" =~ ^[sS]$ ]]; then +# echo "Introduce un Personal Access Token (PAT) de GitHub con permiso de lectura del repo." +# read -rsp "GitHub PAT: " GITHUB_TOKEN +# echo +# if [ -z "$GITHUB_TOKEN" ]; then +# echo "El token no puede estar vacío si el repo es privado." +# exit 1 +# fi +# +# # Construimos una URL del tipo: https://TOKEN@github.com/usuario/repo.git +# if [[ "$REPO_URL" =~ ^https:// ]]; then +# GIT_CLONE_URL="https://${GITHUB_TOKEN}@${REPO_URL#https://}" +# else +# echo "La URL del repositorio debe empezar por https:// para usar el token." +# exit 1 +# fi +#fi +# echo echo "Resumen de configuración:" echo " Dominio: $DOMAIN" echo " Email Let'sEnc: $EMAIL" echo " Usuario API: $API_USER" echo " Repo (visible): $REPO_URL" +echo " Path del despliegue: $INSTALL_DIR" + if [[ "$IS_PRIVATE" =~ ^[sS]$ ]]; then echo " Repo privado: Sí (se usará un PAT sólo para el clon inicial)" else @@ -107,56 +110,56 @@ fi ############################################### # 2. INSTALAR DOCKER + DOCKER COMPOSE + CERTBOT ############################################### -step "Instalando Docker, docker compose plugin y certbot" - -apt-get update -y - -# Dependencias para repositorio Docker -apt-get install -y \ - ca-certificates \ - curl \ - gnupg \ - lsb-release - -# Clave GPG de Docker -if [ ! -f /etc/apt/keyrings/docker.gpg ]; then - install -m 0755 -d /etc/apt/keyrings - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \ - gpg --dearmor -o /etc/apt/keyrings/docker.gpg -fi - -# Repo Docker estable -if [ ! -f /etc/apt/sources.list.d/docker.list ]; then - echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ - $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ - tee /etc/apt/sources.list.d/docker.list > /dev/null -fi - -apt-get update -y - -apt-get install -y \ - docker-ce \ - docker-ce-cli \ - containerd.io \ - docker-buildx-plugin \ - docker-compose-plugin \ - git \ - certbot - -systemctl enable docker -systemctl start docker - -# Abrimos puertos en ufw si está activo -if command -v ufw >/dev/null 2>&1; then - if ufw status | grep -q "Status: active"; then - step "Configurando firewall (ufw) para permitir 80 y 443" - ufw allow 80/tcp || true - ufw allow 443/tcp || true - fi -fi - -############################################### +#step "Instalando Docker, docker compose plugin y certbot" +# +#apt-get update -y +# +## Dependencias para repositorio Docker +#apt-get install -y \ +# ca-certificates \ +# curl \ +# gnupg \ +# lsb-release +# +## Clave GPG de Docker +#if [ ! -f /etc/apt/keyrings/docker.gpg ]; then +# install -m 0755 -d /etc/apt/keyrings +# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \ +# gpg --dearmor -o /etc/apt/keyrings/docker.gpg +#fi +# +## Repo Docker estable +#if [ ! -f /etc/apt/sources.list.d/docker.list ]; then +# echo \ +# "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ +# $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ +# tee /etc/apt/sources.list.d/docker.list > /dev/null +#fi +# +#apt-get update -y +# +#apt-get install -y \ +# docker-ce \ +# docker-ce-cli \ +# containerd.io \ +# docker-buildx-plugin \ +# docker-compose-plugin \ +# git \ +# certbot +# +#systemctl enable docker +#systemctl start docker +# +## Abrimos puertos en ufw si está activo +#if command -v ufw >/dev/null 2>&1; then +# if ufw status | grep -q "Status: active"; then +# step "Configurando firewall (ufw) para permitir 80 y 443" +# ufw allow 80/tcp || true +# ufw allow 443/tcp || true +# fi +#fi +# +################################################ # 3. CLONAR / ACTUALIZAR REPO ############################################### step "Descargando/actualizando el repositorio en $INSTALL_DIR" @@ -189,94 +192,100 @@ else sed -i "s/BASIC_AUTH_PASSWORD:.*/BASIC_AUTH_PASSWORD: \"$API_PASS\"/" docker-compose.yml fi +if ! grep -q "XXX" docker-compose.yml; then + echo "⚠ No encuentro XXX en docker-compose.yml. Revisa el archivo a mano." +else + sed -i "s/XXX/\"$SUBDOMAIN\"/" docker-compose.yml +fi + # Aseguramos que nginx exponga también 443 -if grep -q 'ports:' docker-compose.yml && grep -q 'nginx:' docker-compose.yml; then - if ! grep -q '443:443' docker-compose.yml; then - sed -i '/- "80:80"/a\ - "443:443"' docker-compose.yml || true - fi -fi - -# Aseguramos que montamos /etc/letsencrypt dentro del contenedor de nginx -if ! grep -q '/etc/letsencrypt:/etc/letsencrypt:ro' docker-compose.yml; then - sed -i '/nginx:/,/networks:/{ - /volumes:/a\ - /etc/letsencrypt:/etc/letsencrypt:ro - }' docker-compose.yml || true -fi - +#if grep -q 'ports:' docker-compose.yml && grep -q 'nginx:' docker-compose.yml; then +# if ! grep -q '443:443' docker-compose.yml; then +# sed -i '/- "80:80"/a\ - "443:443"' docker-compose.yml || true +# fi +#fi +# +## Aseguramos que montamos /etc/letsencrypt dentro del contenedor de nginx +#if ! grep -q '/etc/letsencrypt:/etc/letsencrypt:ro' docker-compose.yml; then +# sed -i '/nginx:/,/networks:/{ +# /volumes:/a\ - /etc/letsencrypt:/etc/letsencrypt:ro +# }' docker-compose.yml || true +#fi +# ############################################### # 5. OBTENER CERTIFICADO LET'S ENCRYPT ############################################### -step "Obteniendo certificado SSL de Let’s Encrypt para $DOMAIN" - -if [ -f "/etc/letsencrypt/live/$DOMAIN/fullchain.pem" ]; then - echo "Certificado ya existe, saltando paso de emisión." -else - # Asegurarnos de que no hay nada escuchando en 80/443 - systemctl stop nginx || true - - certbot certonly \ - --standalone \ - --non-interactive \ - --agree-tos \ - -m "$EMAIL" \ - -d "$DOMAIN" - - echo "Certificado emitido en /etc/letsencrypt/live/$DOMAIN/" -fi - -############################################### -# 6. CONFIGURAR NGINX DENTRO DEL REPO -############################################### -step "Generando configuración nginx con SSL" - -mkdir -p nginx/conf.d - -cat > nginx/conf.d/beyond.conf < nginx/conf.d/beyond.conf < Date: Thu, 12 Feb 2026 09:12:29 +0000 Subject: [PATCH 02/65] Change domain_base in traefik labels --- docker-compose.yml | 16 ++++++------- docker-compose.yml.back | 51 ----------------------------------------- 2 files changed, 8 insertions(+), 59 deletions(-) delete mode 100644 docker-compose.yml.back diff --git a/docker-compose.yml b/docker-compose.yml index 68f876c..4992cdc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,11 +17,11 @@ services: networks: - beyond-net - frontend: + XXXfrontend: build: context: ./frontend args: - # el front compilará con este BASE_URL -> /api + # el front compilar con este BASE_URL -> /api VITE_API_BASE_URL: /api container_name: beyond-frontend expose: @@ -31,12 +31,12 @@ services: - frontend labels: - "traefik.enable=true" - - "treafik.http.routers.XXX-https.rule=Host(`XXX.mylab.k8s.org.es`)" - - "traefik.http.routers.XXX-https.entrypoints=websecure" - - "traefik.http.routers.XXX-https.tls=true" - - "traefik.http.routers.XXX-https.tls.certresolver=doresolv" - - "traefik.http.routers.XXX-https.service=XXX-service-scv" - - "traefik.http.services.XXX-service-scv.loadBalancer.server.port=4173" + - "traefik.http.routers.XXX-server.rule=Host(`XXX.analytics.beyondcx.org`)" + - "traefik.http.routers.XXX-server.entrypoints=websecure" + - "traefik.http.routers.XXX-server.tls=true" + - "traefik.http.routers.XXX-server.tls.certresolver=doresolv" + - "traefik.http.routers.XXX-server.service=XXXfrontend" + - "traefik.http.services.XXXfrontend.loadBalancer.server.port=4173" depends_on: - backend diff --git a/docker-compose.yml.back b/docker-compose.yml.back deleted file mode 100644 index c2ee3e3..0000000 --- a/docker-compose.yml.back +++ /dev/null @@ -1,51 +0,0 @@ -version: "3.9" - -services: - backend: - build: - context: ./backend - container_name: beyond-backend - environment: - # credenciales del API (las mismas que usas ahora) - BASIC_AUTH_USERNAME: "beyond" - BASIC_AUTH_PASSWORD: "beyond2026" - CACHE_DIR: "/data/cache" - volumes: - - cache-data:/data/cache - expose: - - "8000" - networks: - - beyond-net - - frontend: - build: - context: ./frontend - args: - # el front compilará con este BASE_URL -> /api - VITE_API_BASE_URL: /api - container_name: beyond-frontend - expose: - - "4173" - networks: - - beyond-net - - frontend - labels: - - "traefik.enable=true" - - "treafik.http.routers.XXX-https.rule=Host('XXX.mylab.k8s.org.es')" - - "traefik.http.routers.XXX-https.entrypoints=websecure" - - "traefik.http.routers.XXX-https.tls=true" - - "traefik.http.routers.XXX-https.tls.certresolver=doresolv" - - "traefik.http.routers.XXX-https.service=XXX-service-scv" - - "traefik.http.services.XXX-service-scv.loadBalancer.server.port=4173" - depends_on: - - backend - -volumes: - cache-data: - driver: local - -networks: - beyond-net: - driver: bridge - frontend: - external: true -- 2.49.1 From 6a8ffe5da8a3913cd5c110d8e6e990461ca0b2ef Mon Sep 17 00:00:00 2001 From: Guillermo Date: Thu, 12 Feb 2026 09:19:56 +0000 Subject: [PATCH 03/65] Actualizado Domain y subdomain --- docker-compose.yml | 2 +- install_beyond.sh | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4992cdc..75352f5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,7 +31,7 @@ services: - frontend labels: - "traefik.enable=true" - - "traefik.http.routers.XXX-server.rule=Host(`XXX.analytics.beyondcx.org`)" + - "traefik.http.routers.XXX-server.rule=Host(`DDD`)" - "traefik.http.routers.XXX-server.entrypoints=websecure" - "traefik.http.routers.XXX-server.tls=true" - "traefik.http.routers.XXX-server.tls.certresolver=doresolv" diff --git a/install_beyond.sh b/install_beyond.sh index c5bdc60..59837d2 100644 --- a/install_beyond.sh +++ b/install_beyond.sh @@ -197,6 +197,16 @@ if ! grep -q "XXX" docker-compose.yml; then else sed -i "s/XXX/\"$SUBDOMAIN\"/" docker-compose.yml fi +if $DOMAIN==$SUBDOMAIN; then + DOMAIN=$DOMAIN".analytics.beyondcx.org" +fi +if ! grep -q "DDD" docker-compose.yml; then + echo "⚠ No encuentro XXX en docker-compose.yml. Revisa el archivo a mano." +else + sed -i "s/DDD/\"$DOMAIN\"/" docker-compose.yml +fi + + # Aseguramos que nginx exponga también 443 #if grep -q 'ports:' docker-compose.yml && grep -q 'nginx:' docker-compose.yml; then -- 2.49.1 From 9effa23d3b136cc599e71a41ecd14ebdcb125495 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Thu, 12 Feb 2026 11:19:18 +0000 Subject: [PATCH 04/65] Bug fixes --- docker-compose.yml | 10 +++++----- install_beyond.sh | 7 +++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 75352f5..c3523a5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: backend: build: context: ./backend - container_name: beyond-backend + container_name: XXX-backend environment: # credenciales del API (las mismas que usas ahora) BASIC_AUTH_USERNAME: "beyond" @@ -15,7 +15,7 @@ services: expose: - "8000" networks: - - beyond-net + - XXX-beyond-net XXXfrontend: build: @@ -23,11 +23,11 @@ services: args: # el front compilar con este BASE_URL -> /api VITE_API_BASE_URL: /api - container_name: beyond-frontend + container_name: XXX-frontend expose: - "4173" networks: - - beyond-net + - XXX-beyond-net - frontend labels: - "traefik.enable=true" @@ -45,7 +45,7 @@ volumes: driver: local networks: - beyond-net: + XXX-beyond-net: driver: bridge frontend: external: true diff --git a/install_beyond.sh b/install_beyond.sh index 59837d2..99a8505 100644 --- a/install_beyond.sh +++ b/install_beyond.sh @@ -6,7 +6,7 @@ set -euo pipefail ############################################### # TODO: pon aquí la URL real de tu repo (sin credenciales) REPO_URL_DEFAULT="https://github.com/igferne/Beyond-Diagnosis.git" -INSTALL_BASE="/home/garbelo/" +INSTALL_BASE="/opt/beyondcx" ############################################### # UTILIDADES @@ -37,7 +37,7 @@ if [ -z "$DOMAIN" ]; then echo "El dominio no puede estar vacío." exit 1 fi -SUBDOMAIN="$DOMAIN%%.*" +SUBDOMAIN=${DOMAIN%%.*} INSTALL_DIR=$INSTALL_BASE"/"$SUBDOMAIN read -rp "Email para Let's Encrypt (avisos de renovación): " EMAIL if [ -z "$EMAIL" ]; then @@ -164,6 +164,9 @@ fi ############################################### step "Descargando/actualizando el repositorio en $INSTALL_DIR" +eval $(ssh-agent -s) +ssh-add /home/garbelo/.ssh/id_ed25519 + if [ -d "$INSTALL_DIR/.git" ]; then echo "Directorio git ya existe, haciendo 'git pull'..." git -C "$INSTALL_DIR" pull --ff-only -- 2.49.1 From 3532f4f621e49ea02368c753de49162e1239a24b Mon Sep 17 00:00:00 2001 From: Guillermo Date: Thu, 12 Feb 2026 11:32:38 +0000 Subject: [PATCH 05/65] adaptations --- install_beyond.sh | 80 +++-------------------------------------------- 1 file changed, 4 insertions(+), 76 deletions(-) diff --git a/install_beyond.sh b/install_beyond.sh index 99a8505..c2c9e3d 100644 --- a/install_beyond.sh +++ b/install_beyond.sh @@ -66,25 +66,6 @@ echo read -rp "¿El repositorio es PRIVADO en GitHub y necesitas token? [s/N]: " IS_PRIVATE IS_PRIVATE=${IS_PRIVATE:-N} -GIT_CLONE_URL="$REPO_URL" -#if [[ "$IS_PRIVATE" =~ ^[sS]$ ]]; then -# echo "Introduce un Personal Access Token (PAT) de GitHub con permiso de lectura del repo." -# read -rsp "GitHub PAT: " GITHUB_TOKEN -# echo -# if [ -z "$GITHUB_TOKEN" ]; then -# echo "El token no puede estar vacío si el repo es privado." -# exit 1 -# fi -# -# # Construimos una URL del tipo: https://TOKEN@github.com/usuario/repo.git -# if [[ "$REPO_URL" =~ ^https:// ]]; then -# GIT_CLONE_URL="https://${GITHUB_TOKEN}@${REPO_URL#https://}" -# else -# echo "La URL del repositorio debe empezar por https:// para usar el token." -# exit 1 -# fi -#fi -# echo echo "Resumen de configuración:" echo " Dominio: $DOMAIN" @@ -107,61 +88,7 @@ if [[ ! "$CONFIRM" =~ ^[sS]$ ]]; then exit 0 fi -############################################### -# 2. INSTALAR DOCKER + DOCKER COMPOSE + CERTBOT -############################################### -#step "Instalando Docker, docker compose plugin y certbot" -# -#apt-get update -y -# -## Dependencias para repositorio Docker -#apt-get install -y \ -# ca-certificates \ -# curl \ -# gnupg \ -# lsb-release -# -## Clave GPG de Docker -#if [ ! -f /etc/apt/keyrings/docker.gpg ]; then -# install -m 0755 -d /etc/apt/keyrings -# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \ -# gpg --dearmor -o /etc/apt/keyrings/docker.gpg -#fi -# -## Repo Docker estable -#if [ ! -f /etc/apt/sources.list.d/docker.list ]; then -# echo \ -# "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ -# $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ -# tee /etc/apt/sources.list.d/docker.list > /dev/null -#fi -# -#apt-get update -y -# -#apt-get install -y \ -# docker-ce \ -# docker-ce-cli \ -# containerd.io \ -# docker-buildx-plugin \ -# docker-compose-plugin \ -# git \ -# certbot -# -#systemctl enable docker -#systemctl start docker -# -## Abrimos puertos en ufw si está activo -#if command -v ufw >/dev/null 2>&1; then -# if ufw status | grep -q "Status: active"; then -# step "Configurando firewall (ufw) para permitir 80 y 443" -# ufw allow 80/tcp || true -# ufw allow 443/tcp || true -# fi -#fi -# -################################################ -# 3. CLONAR / ACTUALIZAR REPO -############################################### +# COMENZAMOS ... step "Descargando/actualizando el repositorio en $INSTALL_DIR" eval $(ssh-agent -s) @@ -173,7 +100,8 @@ if [ -d "$INSTALL_DIR/.git" ]; then else rm -rf "$INSTALL_DIR" echo "Clonando repositorio..." - git clone "$GIT_CLONE_URL" "$INSTALL_DIR" +# git clone "$GIT_CLONE_URL" "$INSTALL_DIR" + git clone -b proxy "$GIT_CLONE_URL" "$INSTALL_DIR" fi cd "$INSTALL_DIR" @@ -200,7 +128,7 @@ if ! grep -q "XXX" docker-compose.yml; then else sed -i "s/XXX/\"$SUBDOMAIN\"/" docker-compose.yml fi -if $DOMAIN==$SUBDOMAIN; then +if [[$DOMAIN == $SUBDOMAIN]]; then DOMAIN=$DOMAIN".analytics.beyondcx.org" fi if ! grep -q "DDD" docker-compose.yml; then -- 2.49.1 From 9e01d9d2fb3026cc87fec76d8ab2a3482fa2575d Mon Sep 17 00:00:00 2001 From: Guillermo Date: Thu, 12 Feb 2026 11:43:27 +0000 Subject: [PATCH 06/65] test --- install_beyond.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install_beyond.sh b/install_beyond.sh index c2c9e3d..f7686df 100644 --- a/install_beyond.sh +++ b/install_beyond.sh @@ -126,13 +126,13 @@ fi if ! grep -q "XXX" docker-compose.yml; then echo "⚠ No encuentro XXX en docker-compose.yml. Revisa el archivo a mano." else - sed -i "s/XXX/\"$SUBDOMAIN\"/" docker-compose.yml + sed -i "s/XXX/$SUBDOMAIN/" docker-compose.yml fi -if [[$DOMAIN == $SUBDOMAIN]]; then - DOMAIN=$DOMAIN".analytics.beyondcx.org" +if [[ $DOMAIN == $SUBDOMAIN ]]; then + set DOMAIN=$DOMAIN".analytics.beyondcx.org" fi if ! grep -q "DDD" docker-compose.yml; then - echo "⚠ No encuentro XXX en docker-compose.yml. Revisa el archivo a mano." + echo "⚠ No encuentro DDD en docker-compose.yml. Revisa el archivo a mano." else sed -i "s/DDD/\"$DOMAIN\"/" docker-compose.yml fi -- 2.49.1 From 2ef0a742e1d57e570387c042094d78c1a11bc392 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Thu, 12 Feb 2026 11:58:28 +0000 Subject: [PATCH 07/65] double quotes --- install_beyond.sh | 112 +++++----------------------------------------- 1 file changed, 11 insertions(+), 101 deletions(-) diff --git a/install_beyond.sh b/install_beyond.sh index f7686df..74f0101 100644 --- a/install_beyond.sh +++ b/install_beyond.sh @@ -5,7 +5,7 @@ set -euo pipefail # CONFIGURACIÓN BÁSICA – EDITA ESTO ############################################### # TODO: pon aquí la URL real de tu repo (sin credenciales) -REPO_URL_DEFAULT="https://github.com/igferne/Beyond-Diagnosis.git" +REPO_URL_DEFAULT="ssh://git@git.beyondcx.org:2424/susana/BeyondCXAnalytics-Demo.git" INSTALL_BASE="/opt/beyondcx" ############################################### @@ -37,7 +37,13 @@ if [ -z "$DOMAIN" ]; then echo "El dominio no puede estar vacío." exit 1 fi + SUBDOMAIN=${DOMAIN%%.*} +if [[ $DOMAIN == $SUBDOMAIN ]]; then + DOMAIN=$DOMAIN".analytics.beyondcx.org" +fi +echo "el dominio es $DOMAIN y el subdominio $SUBDOMAIN" + INSTALL_DIR=$INSTALL_BASE"/"$SUBDOMAIN read -rp "Email para Let's Encrypt (avisos de renovación): " EMAIL if [ -z "$EMAIL" ]; then @@ -66,6 +72,8 @@ echo read -rp "¿El repositorio es PRIVADO en GitHub y necesitas token? [s/N]: " IS_PRIVATE IS_PRIVATE=${IS_PRIVATE:-N} +GIT_CLONE_URL="$REPO_URL" + echo echo "Resumen de configuración:" echo " Dominio: $DOMAIN" @@ -74,13 +82,6 @@ echo " Usuario API: $API_USER" echo " Repo (visible): $REPO_URL" echo " Path del despliegue: $INSTALL_DIR" -if [[ "$IS_PRIVATE" =~ ^[sS]$ ]]; then - echo " Repo privado: Sí (se usará un PAT sólo para el clon inicial)" -else - echo " Repo privado: No" -fi -echo - read -rp "¿Continuar con la instalación? [s/N]: " CONFIRM CONFIRM=${CONFIRM:-N} if [[ ! "$CONFIRM" =~ ^[sS]$ ]]; then @@ -134,107 +135,16 @@ fi if ! grep -q "DDD" docker-compose.yml; then echo "⚠ No encuentro DDD en docker-compose.yml. Revisa el archivo a mano." else - sed -i "s/DDD/\"$DOMAIN\"/" docker-compose.yml + sed -i "s/DDD/$DOMAIN/" docker-compose.yml fi -# Aseguramos que nginx exponga también 443 -#if grep -q 'ports:' docker-compose.yml && grep -q 'nginx:' docker-compose.yml; then -# if ! grep -q '443:443' docker-compose.yml; then -# sed -i '/- "80:80"/a\ - "443:443"' docker-compose.yml || true -# fi -#fi -# -## Aseguramos que montamos /etc/letsencrypt dentro del contenedor de nginx -#if ! grep -q '/etc/letsencrypt:/etc/letsencrypt:ro' docker-compose.yml; then -# sed -i '/nginx:/,/networks:/{ -# /volumes:/a\ - /etc/letsencrypt:/etc/letsencrypt:ro -# }' docker-compose.yml || true -#fi -# -############################################### -# 5. OBTENER CERTIFICADO LET'S ENCRYPT -############################################### -#step "Obteniendo certificado SSL de Let’s Encrypt para $DOMAIN" -# -#if [ -f "/etc/letsencrypt/live/$DOMAIN/fullchain.pem" ]; then -# echo "Certificado ya existe, saltando paso de emisión." -#else -# # Asegurarnos de que no hay nada escuchando en 80/443 -# systemctl stop nginx || true -# -# certbot certonly \ -# --standalone \ -# --non-interactive \ -# --agree-tos \ -# -m "$EMAIL" \ -# -d "$DOMAIN" -# -# echo "Certificado emitido en /etc/letsencrypt/live/$DOMAIN/" -#fi -# -################################################ -## 6. CONFIGURAR NGINX DENTRO DEL REPO -################################################ -#step "Generando configuración nginx con SSL" -# -#mkdir -p nginx/conf.d -# -#cat > nginx/conf.d/beyond.conf < Date: Thu, 12 Feb 2026 12:51:33 +0000 Subject: [PATCH 08/65] sed command +g --- install_beyond.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_beyond.sh b/install_beyond.sh index 74f0101..7bf0b45 100644 --- a/install_beyond.sh +++ b/install_beyond.sh @@ -127,7 +127,7 @@ fi if ! grep -q "XXX" docker-compose.yml; then echo "⚠ No encuentro XXX en docker-compose.yml. Revisa el archivo a mano." else - sed -i "s/XXX/$SUBDOMAIN/" docker-compose.yml + sed -i "s/XXX/$SUBDOMAIN/g" docker-compose.yml fi if [[ $DOMAIN == $SUBDOMAIN ]]; then set DOMAIN=$DOMAIN".analytics.beyondcx.org" -- 2.49.1 From 022f04b9ed17c2798b0423a25f58906c66a2e56a Mon Sep 17 00:00:00 2001 From: Guillermo Date: Thu, 12 Feb 2026 12:53:13 +0000 Subject: [PATCH 09/65] cleaning install script --- install_beyond.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_beyond.sh b/install_beyond.sh index 7bf0b45..7858fed 100644 --- a/install_beyond.sh +++ b/install_beyond.sh @@ -144,7 +144,7 @@ step "Construyendo imágenes Docker y arrancando contenedores" docker compose build docker compose up -d -gg + ############################################### # 8. FIN ############################################### -- 2.49.1 From af4a5a35c7d55614221442ece0c97e5731a45779 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Thu, 12 Feb 2026 13:00:40 +0000 Subject: [PATCH 10/65] looks clean --- install_beyond.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/install_beyond.sh b/install_beyond.sh index 7858fed..74a5e83 100644 --- a/install_beyond.sh +++ b/install_beyond.sh @@ -45,11 +45,6 @@ fi echo "el dominio es $DOMAIN y el subdominio $SUBDOMAIN" INSTALL_DIR=$INSTALL_BASE"/"$SUBDOMAIN -read -rp "Email para Let's Encrypt (avisos de renovación): " EMAIL -if [ -z "$EMAIL" ]; then - echo "El email no puede estar vacío." - exit 1 -fi read -rp "Usuario de acceso (Basic Auth / login): " API_USER if [ -z "$API_USER" ]; then @@ -68,16 +63,11 @@ echo read -rp "URL del repositorio Git (HTTPS, sin credenciales) [$REPO_URL_DEFAULT]: " REPO_URL REPO_URL=${REPO_URL:-$REPO_URL_DEFAULT} -echo -read -rp "¿El repositorio es PRIVADO en GitHub y necesitas token? [s/N]: " IS_PRIVATE -IS_PRIVATE=${IS_PRIVATE:-N} - GIT_CLONE_URL="$REPO_URL" echo echo "Resumen de configuración:" echo " Dominio: $DOMAIN" -echo " Email Let'sEnc: $EMAIL" echo " Usuario API: $API_USER" echo " Repo (visible): $REPO_URL" echo " Path del despliegue: $INSTALL_DIR" -- 2.49.1 From 02d25ea19f274197681322bca33b882270b310ca Mon Sep 17 00:00:00 2001 From: Guillermo Date: Thu, 12 Feb 2026 13:20:00 +0000 Subject: [PATCH 11/65] script to deploy traefik in server --- prepare_server.sh | 144 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 prepare_server.sh diff --git a/prepare_server.sh b/prepare_server.sh new file mode 100644 index 0000000..1cf2916 --- /dev/null +++ b/prepare_server.sh @@ -0,0 +1,144 @@ +#!/usr/bin/env bash +set -euo pipefail + +require_root() { + if [ "$(id -u)" -ne 0 ]; then + echo "Este script debe ejecutarse como root (o con sudo)." + exit 1 + fi +} + +require_root + +step "Instalando Docker, docker compose plugin y certbot" + +apt-get update -y + +# Dependencias para repositorio Docker +apt-get install -y \ + ca-certificates \ + curl \ + gnupg \ + lsb-release + +# Clave GPG de Docker +if [ ! -f /etc/apt/keyrings/docker.gpg ]; then + install -m 0755 -d /etc/apt/keyrings + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \ + gpg --dearmor -o /etc/apt/keyrings/docker.gpg +fi + +# Repo Docker estable +if [ ! -f /etc/apt/sources.list.d/docker.list ]; then + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null +fi + +apt-get update -y + +apt-get install -y \ + docker-ce \ + docker-ce-cli \ + containerd.io \ + docker-buildx-plugin \ + docker-compose-plugin \ + git \ + certbot + +systemctl enable docker +systemctl start docker + +# Abrimos puertos en ufw si está activo +if command -v ufw >/dev/null 2>&1; then + if ufw status | grep -q "Status: active"; then + step "Configurando firewall (ufw) para permitir 80 y 443" + ufw allow 80/tcp || true + ufw allow 443/tcp || true + fi +fi + +# Creamos carpeta del proxy con docker compose. + +mkdir -p /opt/beyonxcx/traefik + +cat > /opt/beyondcx/traefik/docker-compose.yaml < /opt/beyondcx/traefik/config/traefik.yml < Date: Thu, 12 Feb 2026 14:17:28 +0000 Subject: [PATCH 12/65] fixing bugs --- prepare_server.sh | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/prepare_server.sh b/prepare_server.sh index 1cf2916..fbb10c5 100644 --- a/prepare_server.sh +++ b/prepare_server.sh @@ -1,6 +1,15 @@ #!/usr/bin/env bash set -euo pipefail + +step() { + echo + echo "==================================================" + echo " 👉 $1" + echo "==================================================" +} + + require_root() { if [ "$(id -u)" -ne 0 ]; then echo "Este script debe ejecutarse como root (o con sudo)." @@ -44,8 +53,7 @@ apt-get install -y \ containerd.io \ docker-buildx-plugin \ docker-compose-plugin \ - git \ - certbot + git systemctl enable docker systemctl start docker @@ -61,7 +69,7 @@ fi # Creamos carpeta del proxy con docker compose. -mkdir -p /opt/beyonxcx/traefik +mkdir -p /opt/beyondcx/traefik cat > /opt/beyondcx/traefik/docker-compose.yaml < /dev/null 2>&1; then + echo "red de traefik existe" +else + docker network create $PROXY_NETWORK +fi docker compose up -d -- 2.49.1 From 4039dc54cb61dd10a87e75b1ca8eec0e69323b8e Mon Sep 17 00:00:00 2001 From: Guillermo Date: Thu, 12 Feb 2026 14:19:56 +0000 Subject: [PATCH 13/65] traefik version updated --- prepare_server.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prepare_server.sh b/prepare_server.sh index fbb10c5..672dee1 100644 --- a/prepare_server.sh +++ b/prepare_server.sh @@ -74,7 +74,7 @@ mkdir -p /opt/beyondcx/traefik cat > /opt/beyondcx/traefik/docker-compose.yaml < Date: Thu, 12 Feb 2026 22:08:48 +0000 Subject: [PATCH 14/65] test gitea action --- .gitea/workflows/example.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .gitea/workflows/example.yaml diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml new file mode 100644 index 0000000..54a7158 --- /dev/null +++ b/.gitea/workflows/example.yaml @@ -0,0 +1,18 @@ +name: Workflow de prueba + +on: + - push + +jobs: + Build and push images: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + - name: Setup Buildx + uses: docker/setup-buildx-action@v3 + with: + driver-opts: network=hiost + -- 2.49.1 From 2747bef89880517299b7ac1514f86bd5a59757a9 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 07:43:13 +0000 Subject: [PATCH 15/65] fix typo in action --- .gitea/workflows/example.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index 54a7158..b56fd18 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -14,5 +14,5 @@ jobs: - name: Setup Buildx uses: docker/setup-buildx-action@v3 with: - driver-opts: network=hiost + driver-opts: network=host -- 2.49.1 From eea9bcd8857c7d5c999422913b42e8dba5a065a5 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 08:41:24 +0000 Subject: [PATCH 16/65] Added a new step --- .gitea/workflows/example.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index b56fd18..e33dcdf 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -9,10 +9,20 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Setup QEMU uses: docker/setup-qemu-action@v3 + - name: Setup Buildx uses: docker/setup-buildx-action@v3 with: driver-opts: network=host + - name: Build + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: beyondcx/beyondcx:latest + + -- 2.49.1 From 0f67f16047207426a2902ee044101a9fae4bbe4d Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 11:49:12 +0000 Subject: [PATCH 17/65] With registry URL & credentials --- .gitea/workflows/example.yaml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index e33dcdf..17e08f9 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -3,6 +3,10 @@ name: Workflow de prueba on: - push +env: + DOCKER_ORG: beyondcx + BRANCH_NAME: ${{ github.ref_name }} + jobs: Build and push images: runs-on: ubuntu-latest @@ -10,6 +14,9 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Extract Branch Name + run: echo "BRANCH_NAME=${gitea.ref#refs/heads/}" >> env.BRANCH_NAME + - name: Setup QEMU uses: docker/setup-qemu-action@v3 @@ -17,12 +24,23 @@ jobs: uses: docker/setup-buildx-action@v3 with: driver-opts: network=host + + - name: Login to Registry + uses: docker/login-action@v3 + with: + url: git.beyondcx.org + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGITRY_PWD }} + + - name: Echo the Tag + run: echo "Tag: ${{ env.DOCKER_ORG }}/beyondcx:${BRANCH_NAME} }}" - name: Build uses: docker/build-push-action@v3 with: context: . - push: true - tags: beyondcx/beyondcx:latest + push: false + tags: ${{ env.DOCKER_ORG }}/beyondcx:${{ env.BRANCH_NAME }} + platforms: linux/amd64,linux/arm64 -- 2.49.1 From 26534774ef522ded77d35c11caf490cf3a3d6488 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 11:50:40 +0000 Subject: [PATCH 18/65] bug fixed? --- .gitea/workflows/example.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index 17e08f9..197c5fb 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -5,7 +5,7 @@ on: env: DOCKER_ORG: beyondcx - BRANCH_NAME: ${{ github.ref_name }} + BRANCH_NAME: main jobs: Build and push images: -- 2.49.1 From a92fb51b5d5ab33967e30287a0577d0aa1a8ac3c Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 11:51:47 +0000 Subject: [PATCH 19/65] bug fixed? --- .gitea/workflows/example.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index 197c5fb..366d179 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -33,7 +33,7 @@ jobs: password: ${{ secrets.REGITRY_PWD }} - name: Echo the Tag - run: echo "Tag: ${{ env.DOCKER_ORG }}/beyondcx:${BRANCH_NAME} }}" + run: echo "Tag ${{ env.DOCKER_ORG }}/beyondcx:${{ env.BRANCH_NAME }}" - name: Build uses: docker/build-push-action@v3 -- 2.49.1 From 1f2928a71d300bb51d5166e306ab9b47075c1503 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 11:57:40 +0000 Subject: [PATCH 20/65] bug fixed? --- .gitea/workflows/example.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index 366d179..9b91e52 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v4 - name: Extract Branch Name - run: echo "BRANCH_NAME=${gitea.ref#refs/heads/}" >> env.BRANCH_NAME + run: echo "BRANCH_NAME=${{ gitea.ref_name }}" >> env.BRANCH_NAME - name: Setup QEMU uses: docker/setup-qemu-action@v3 -- 2.49.1 From 3721bdd35fe6f3f9f14c10b0fd498bb1fa0fbd08 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 12:40:35 +0000 Subject: [PATCH 21/65] typo fixed --- .gitea/workflows/example.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index 9b91e52..ff69576 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -30,7 +30,7 @@ jobs: with: url: git.beyondcx.org username: ${{ secrets.REGISTRY_USER }} - password: ${{ secrets.REGITRY_PWD }} + password: ${{ secrets.REGISTRY_PWD }} - name: Echo the Tag run: echo "Tag ${{ env.DOCKER_ORG }}/beyondcx:${{ env.BRANCH_NAME }}" -- 2.49.1 From 083e398f5d153a10be1082fa584f18ef3b2a26e0 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 12:49:53 +0000 Subject: [PATCH 22/65] bad param name? --- .gitea/workflows/example.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index ff69576..2e4f6bf 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -28,7 +28,7 @@ jobs: - name: Login to Registry uses: docker/login-action@v3 with: - url: git.beyondcx.org + registry: git.beyondcx.org username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_PWD }} -- 2.49.1 From d252607c7911ce6cd480e9dae94e9676584e36b0 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 12:53:43 +0000 Subject: [PATCH 23/65] without QEMU --- .gitea/workflows/example.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index 2e4f6bf..b28b356 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -17,8 +17,8 @@ jobs: - name: Extract Branch Name run: echo "BRANCH_NAME=${{ gitea.ref_name }}" >> env.BRANCH_NAME - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 + #- name: Setup QEMU + # uses: docker/setup-qemu-action@v3 - name: Setup Buildx uses: docker/setup-buildx-action@v3 -- 2.49.1 From 46b85f5ee7fc175ba2f779894c8d09073d78071e Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 13:06:16 +0000 Subject: [PATCH 24/65] without QEMU & pushing to registry --- .gitea/workflows/example.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index b28b356..e74698c 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -39,7 +39,7 @@ jobs: uses: docker/build-push-action@v3 with: context: . - push: false + push: true tags: ${{ env.DOCKER_ORG }}/beyondcx:${{ env.BRANCH_NAME }} platforms: linux/amd64,linux/arm64 -- 2.49.1 From 807bcc8034505368347a007f62e733fb208d32ee Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 13:23:01 +0000 Subject: [PATCH 25/65] registry problems --- .gitea/workflows/example.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index e74698c..f2a9985 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v4 - name: Extract Branch Name - run: echo "BRANCH_NAME=${{ gitea.ref_name }}" >> env.BRANCH_NAME + run: echo "${{ gitea.ref }}" | sed 's|refs/heads/||' >> env.BRANCH_NAME #- name: Setup QEMU # uses: docker/setup-qemu-action@v3 @@ -25,6 +25,9 @@ jobs: with: driver-opts: network=host + - name: Echo the Tag + run: echo "Tag ${{ env.DOCKER_ORG }}/beyondcx:${{ env.BRANCH_NAME }}" + - name: Login to Registry uses: docker/login-action@v3 with: @@ -32,11 +35,8 @@ jobs: username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_PWD }} - - name: Echo the Tag - run: echo "Tag ${{ env.DOCKER_ORG }}/beyondcx:${{ env.BRANCH_NAME }}" - - name: Build - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: . push: true -- 2.49.1 From 57d2bcdd07a54be7b7744dccdb43e59243444354 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 13:28:37 +0000 Subject: [PATCH 26/65] remove amr64 --- .gitea/workflows/example.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index f2a9985..3e5878d 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -15,6 +15,7 @@ jobs: uses: actions/checkout@v4 - name: Extract Branch Name + run: echo "${{ gitea.ref }}" run: echo "${{ gitea.ref }}" | sed 's|refs/heads/||' >> env.BRANCH_NAME #- name: Setup QEMU @@ -41,6 +42,6 @@ jobs: context: . push: true tags: ${{ env.DOCKER_ORG }}/beyondcx:${{ env.BRANCH_NAME }} - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 -- 2.49.1 From 559f49db8a73bab8bb1b20a060161ea660f9559d Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 13:29:50 +0000 Subject: [PATCH 27/65] remove amr64 --- .gitea/workflows/example.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index 3e5878d..f03e4f0 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -15,8 +15,8 @@ jobs: uses: actions/checkout@v4 - name: Extract Branch Name - run: echo "${{ gitea.ref }}" - run: echo "${{ gitea.ref }}" | sed 's|refs/heads/||' >> env.BRANCH_NAME + run: echo "${{ gitea.ref }}" ; + echo "${{ gitea.ref }}" | sed 's|refs/heads/||' >> env.BRANCH_NAME #- name: Setup QEMU # uses: docker/setup-qemu-action@v3 -- 2.49.1 From caa7cfb564c0cd1cbb95eb0d49b1915816683fe4 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 13:42:27 +0000 Subject: [PATCH 28/65] remove amr64 --- .gitea/workflows/example.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index f03e4f0..ed556eb 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -41,7 +41,7 @@ jobs: with: context: . push: true - tags: ${{ env.DOCKER_ORG }}/beyondcx:${{ env.BRANCH_NAME }} + tags: git.beyondcx.org/${{ env.DOCKER_ORG }}:analytics-${{ env.BRANCH_NAME }} platforms: linux/amd64 -- 2.49.1 From 1cc463f659612d3b11286449e13c482488c2c224 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 13:46:11 +0000 Subject: [PATCH 29/65] bad user to push --- .gitea/workflows/example.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index ed556eb..d39e045 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -41,7 +41,7 @@ jobs: with: context: . push: true - tags: git.beyondcx.org/${{ env.DOCKER_ORG }}:analytics-${{ env.BRANCH_NAME }} + tags: ${{ env.DOCKER_ORG }}/analytics:${{ env.BRANCH_NAME }} platforms: linux/amd64 -- 2.49.1 From f8323ea41966469b1a44dc1c2fb0a9d8396824ec Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 13:51:41 +0000 Subject: [PATCH 30/65] bad user to push --- .gitea/workflows/example.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index d39e045..614d45a 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -5,7 +5,7 @@ on: env: DOCKER_ORG: beyondcx - BRANCH_NAME: main + BRANCH_NAME: ${{ gitea.ref | replace('refs/heads/', '') }} jobs: Build and push images: @@ -16,8 +16,8 @@ jobs: - name: Extract Branch Name run: echo "${{ gitea.ref }}" ; - echo "${{ gitea.ref }}" | sed 's|refs/heads/||' >> env.BRANCH_NAME - + echo env.BRANCH_NAME + #- name: Setup QEMU # uses: docker/setup-qemu-action@v3 @@ -41,7 +41,7 @@ jobs: with: context: . push: true - tags: ${{ env.DOCKER_ORG }}/analytics:${{ env.BRANCH_NAME }} + tags: garbelo/analytics:${{ env.BRANCH_NAME }} platforms: linux/amd64 -- 2.49.1 From 9f04467a6d363178facd97b2da7f249d12b12626 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 13:53:31 +0000 Subject: [PATCH 31/65] bad user to push --- .gitea/workflows/example.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index 614d45a..4cb8881 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -16,7 +16,7 @@ jobs: - name: Extract Branch Name run: echo "${{ gitea.ref }}" ; - echo env.BRANCH_NAME + echo ${{ env.BRANCH_NAME }} #- name: Setup QEMU # uses: docker/setup-qemu-action@v3 @@ -41,7 +41,7 @@ jobs: with: context: . push: true - tags: garbelo/analytics:${{ env.BRANCH_NAME }} + tags: ${{ env.DOCKER_ORG }}/garbelo/analytics:${{ env.BRANCH_NAME }} platforms: linux/amd64 -- 2.49.1 From 5edfd256c1ed955a1846cee6049084b91af6f4bf Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 13:55:42 +0000 Subject: [PATCH 32/65] branch --- .gitea/workflows/example.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index 4cb8881..4475702 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -16,6 +16,7 @@ jobs: - name: Extract Branch Name run: echo "${{ gitea.ref }}" ; + echo "${{ gitea.ref }}" | sed 's|refs/heads/||' ; echo ${{ env.BRANCH_NAME }} #- name: Setup QEMU -- 2.49.1 From a5fe8414ded8ff47bdbe59ebbd5eaaf3464dcaa0 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 13:56:26 +0000 Subject: [PATCH 33/65] branch --- .gitea/workflows/example.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index 4475702..ee71a37 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -16,7 +16,7 @@ jobs: - name: Extract Branch Name run: echo "${{ gitea.ref }}" ; - echo "${{ gitea.ref }}" | sed 's|refs/heads/||' ; + echo "${{ gitea.ref }}" | sed 's|refs/heads/||' >> env.BRANCH_NAME ; echo ${{ env.BRANCH_NAME }} #- name: Setup QEMU -- 2.49.1 From 80df1368b1e51c81c99ff0b7fd059bbbe4f21a5f Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 14:01:07 +0000 Subject: [PATCH 34/65] branch --- .gitea/workflows/example.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index ee71a37..0250f1b 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -5,7 +5,7 @@ on: env: DOCKER_ORG: beyondcx - BRANCH_NAME: ${{ gitea.ref | replace('refs/heads/', '') }} + BRANCH_NAME: proxy jobs: Build and push images: @@ -16,7 +16,8 @@ jobs: - name: Extract Branch Name run: echo "${{ gitea.ref }}" ; - echo "${{ gitea.ref }}" | sed 's|refs/heads/||' >> env.BRANCH_NAME ; + echo "${{ gitea.ref }}" | sed 's|refs/heads/||' ; + echo ${{ env.BRANCH_NAME }} #- name: Setup QEMU -- 2.49.1 From 8bb952eba5683630610970fa793be842f5b0a071 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Fri, 13 Feb 2026 14:04:11 +0000 Subject: [PATCH 35/65] branch --- .gitea/workflows/example.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index 0250f1b..bb632b2 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -43,7 +43,7 @@ jobs: with: context: . push: true - tags: ${{ env.DOCKER_ORG }}/garbelo/analytics:${{ env.BRANCH_NAME }} + tags: ${{ env.DOCKER_ORG }}/analytics:${{ env.BRANCH_NAME }} platforms: linux/amd64 -- 2.49.1 From d924636defdc1b77473186502d08d34825fa9720 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Sat, 14 Feb 2026 10:45:41 +0000 Subject: [PATCH 36/65] new registry --- .gitea/workflows/example.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index bb632b2..41565aa 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -34,7 +34,7 @@ jobs: - name: Login to Registry uses: docker/login-action@v3 with: - registry: git.beyondcx.org + registry: ${{ secrets.REGISTRY_URL }} username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_PWD }} -- 2.49.1 From 7923b8c13e97a1d39de492cb849074a8e129a8a4 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Sat, 14 Feb 2026 11:23:44 +0000 Subject: [PATCH 37/65] new test --- .gitea/workflows/example.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index 41565aa..31d3673 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -43,7 +43,7 @@ jobs: with: context: . push: true - tags: ${{ env.DOCKER_ORG }}/analytics:${{ env.BRANCH_NAME }} + tags: analytics:${{ env.BRANCH_NAME }} platforms: linux/amd64 -- 2.49.1 From 2a070ab921cc426eaa374dcc3eac936e966185cf Mon Sep 17 00:00:00 2001 From: Guillermo Date: Sat, 14 Feb 2026 11:39:18 +0000 Subject: [PATCH 38/65] new tag of image --- .gitea/workflows/example.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index 31d3673..fe8abf3 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -43,7 +43,7 @@ jobs: with: context: . push: true - tags: analytics:${{ env.BRANCH_NAME }} + tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/analytics:${{ env.BRANCH_NAME }} platforms: linux/amd64 -- 2.49.1 From 070af13d8647d5b2425aa7726c781daae3736b04 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Sat, 14 Feb 2026 11:57:57 +0000 Subject: [PATCH 39/65] push differents images --- .gitea/workflows/example.yaml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index fe8abf3..e21f970 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -38,12 +38,22 @@ jobs: username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_PWD }} - - name: Build + - name: Build frontend and push it to registry uses: docker/build-push-action@v5 with: - context: . + context: frontend push: true - tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/analytics:${{ env.BRANCH_NAME }} + tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/frontend-analytics-demo:${{ env.BRANCH_NAME }} platforms: linux/amd64 + file: frontend/Dockerfile + + - name: Build backend and push it to registry + uses: docker/build-push-action@v5 + with: + context: frontend + push: true + tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/backed-analytics-demo:${{ env.BRANCH_NAME }} + platforms: linux/amd64 + file: backend/Dockerfile -- 2.49.1 From 77b61d3f33211f0c8e3a1c7fa2fe13d354894dd7 Mon Sep 17 00:00:00 2001 From: garbelo Date: Sat, 14 Feb 2026 18:41:30 +0000 Subject: [PATCH 40/65] Change backend build context --- .gitea/workflows/example.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index e21f970..c1fde60 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -50,7 +50,7 @@ jobs: - name: Build backend and push it to registry uses: docker/build-push-action@v5 with: - context: frontend + context: backend push: true tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/backed-analytics-demo:${{ env.BRANCH_NAME }} platforms: linux/amd64 -- 2.49.1 From c5064383fe84c3586f2afe8716d69a0a3007a04e Mon Sep 17 00:00:00 2001 From: garbelo Date: Sat, 14 Feb 2026 19:04:01 +0000 Subject: [PATCH 41/65] fix typo in image name --- .gitea/workflows/example.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index c1fde60..a4debb9 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -52,7 +52,7 @@ jobs: with: context: backend push: true - tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/backed-analytics-demo:${{ env.BRANCH_NAME }} + tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/backend-analytics-demo:${{ env.BRANCH_NAME }} platforms: linux/amd64 file: backend/Dockerfile -- 2.49.1 From 2433b48c35dba9d63f8f7f03c6cc62e9f9034be9 Mon Sep 17 00:00:00 2001 From: garbelo Date: Sat, 14 Feb 2026 22:50:49 +0000 Subject: [PATCH 42/65] image frontend reduction --- frontend/Dockerfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 8853524..73cb43e 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -21,16 +21,18 @@ ENV VITE_API_BASE_URL=${VITE_API_BASE_URL} RUN npm run build # 2) Fase de servidor estático -FROM node:20-alpine +# FROM node:20-alpine +FROM nginx:alpine -WORKDIR /app +# WORKDIR /app +RUN rm -rf /usr/share/nginx/html/* # Copiamos el build -COPY --from=build /app/dist ./dist +COPY --from=build /app/dist /usr/share/nginx/html # Server estático muy simple -RUN npm install -g serve +# RUN npm install -g serve -EXPOSE 4173 +EXPOSE 80 -CMD ["serve", "-s", "dist", "-l", "4173"] +CMD ["nginx", "-g", "daemon off;"] -- 2.49.1 From 8cfce22f1dede1544ebb5105806ba1b11c6a2051 Mon Sep 17 00:00:00 2001 From: garbelo Date: Sat, 14 Feb 2026 23:03:29 +0000 Subject: [PATCH 43/65] slimer image --- backend/Dockerfile | 74 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 66 insertions(+), 8 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 88c0b4e..eeb2a02 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,31 +1,89 @@ # backend/Dockerfile -FROM python:3.11-slim +#FROM python:3.11-slim # Evitar .pyc y buffering +#ENV PYTHONDONTWRITEBYTECODE3=1 +#ENV PYTHONUNBUFFERED=1 + +#WORKDIR /app + +# Dependencias del sistema mínimas +#RUN apt-get update && apt-get install -y --no-install-recommends \ +# build-essential \ +# && rm -rf /var/lib/apt/lists/* + +# Copiamos pyproject y lock si lo hubiera +#COPY pyproject.toml ./ + +# Instalamos dependencias +#RUN pip install --upgrade pip && \ +# pip install . + +# Copiamos el resto del código (respetando .dockerignore) +#COPY . . + +# Variables de autenticación básica +#ENV BASIC_AUTH_USERNAME=admin +#ENV BASIC_AUTH_PASSWORD=admin + +#EXPOSE 8000 + +#CMD ["python", "-m", "uvicorn", "beyond_api.main:app", "--host", "0.0.0.0", "--port", "8000"] +# --------------------------- +# 1️⃣ Builder stage +# --------------------------- +FROM python:3.11-slim AS builder + ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 WORKDIR /app -# Dependencias del sistema mínimas +# Solo para compilar dependencias RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ && rm -rf /var/lib/apt/lists/* -# Copiamos pyproject y lock si lo hubiera +# Copiamos archivos de dependencias primero (mejor cache) COPY pyproject.toml ./ -# Instalamos dependencias +# Creamos wheels (más limpio para producción) RUN pip install --upgrade pip && \ - pip install . + pip wheel --no-cache-dir --no-deps --wheel-dir /wheels . -# Copiamos el resto del código (respetando .dockerignore) + +# --------------------------- +# 2️⃣ Runtime stage +# --------------------------- +FROM python:3.11-slim + +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 + +WORKDIR /app + +# Crear usuario no-root (mejor seguridad) +RUN useradd --create-home appuser + +# Copiar wheels generados +COPY --from=builder /wheels /wheels + +# Instalar dependencias sin herramientas de compilación +RUN pip install --upgrade pip && \ + pip install --no-cache-dir /wheels/* && \ + rm -rf /wheels + +# Copiar código COPY . . -# Variables de autenticación básica +# Cambiar propietario +RUN chown -R appuser:appuser /app + +USER appuser + ENV BASIC_AUTH_USERNAME=admin ENV BASIC_AUTH_PASSWORD=admin EXPOSE 8000 -CMD ["python", "-m", "uvicorn", "beyond_api.main:app", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "beyond_api.main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file -- 2.49.1 From b50e3c756c80987ca23b52957a1dc68aeeada9ec Mon Sep 17 00:00:00 2001 From: garbelo Date: Sat, 14 Feb 2026 23:04:32 +0000 Subject: [PATCH 44/65] reduce image --- backend/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index eeb2a02..96a5be9 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -30,7 +30,7 @@ #CMD ["python", "-m", "uvicorn", "beyond_api.main:app", "--host", "0.0.0.0", "--port", "8000"] # --------------------------- -# 1️⃣ Builder stage +# Builder stage # --------------------------- FROM python:3.11-slim AS builder @@ -53,7 +53,7 @@ RUN pip install --upgrade pip && \ # --------------------------- -# 2️⃣ Runtime stage +# Runtime stage # --------------------------- FROM python:3.11-slim -- 2.49.1 From 232a687942035376171026edf96d3a9d47e6ff2c Mon Sep 17 00:00:00 2001 From: garbelo Date: Sat, 14 Feb 2026 23:21:46 +0000 Subject: [PATCH 45/65] ignore more files --- backend/.dockerignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/.dockerignore b/backend/.dockerignore index 3fda664..e5f44c8 100644 --- a/backend/.dockerignore +++ b/backend/.dockerignore @@ -11,3 +11,8 @@ build data/output *.zip .DS_Store +*.log +Dockerfile +docker-compose.yml +.env +tests -- 2.49.1 From 5e688aa1fad1ee3797c4a60e37f30c830220a193 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Sun, 15 Feb 2026 10:38:22 +0000 Subject: [PATCH 46/65] vuelta a node par aservir frontend --- frontend/Dockerfile | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 73cb43e..6858d52 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -20,19 +20,22 @@ ENV VITE_API_BASE_URL=${VITE_API_BASE_URL} # Construimos el bundle RUN npm run build -# 2) Fase de servidor estático -# FROM node:20-alpine -FROM nginx:alpine +# 2) Fase de servidor estático. Tenemos que revisar +FROM node:20-alpine +#FROM nginx:alpine -# WORKDIR /app -RUN rm -rf /usr/share/nginx/html/* +WORKDIR /app +#RUN rm -rf /usr/share/nginx/html/* # Copiamos el build -COPY --from=build /app/dist /usr/share/nginx/html +#COPY --from=build /app/dist /usr/share/nginx/html +COPY --from=build /app/dist ./dist # Server estático muy simple -# RUN npm install -g serve +RUN npm install -g serve -EXPOSE 80 +#EXPOSE 80 +EXPOSE 4173 -CMD ["nginx", "-g", "daemon off;"] +#CMD ["nginx", "-g", "daemon off;"] +CMD ["serve", "-s", "dist", "-l", "4173"] -- 2.49.1 From 47070f71dba333403c7bb12e6945735dba2a53f8 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Sun, 15 Feb 2026 11:06:09 +0000 Subject: [PATCH 47/65] trying to reduce image size --- backend/Dockerfile | 80 +++++++++++----------------------------------- 1 file changed, 18 insertions(+), 62 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 96a5be9..d64351d 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,89 +1,45 @@ -# backend/Dockerfile -#FROM python:3.11-slim -# Evitar .pyc y buffering -#ENV PYTHONDONTWRITEBYTECODE3=1 -#ENV PYTHONUNBUFFERED=1 - -#WORKDIR /app - -# Dependencias del sistema mínimas -#RUN apt-get update && apt-get install -y --no-install-recommends \ -# build-essential \ -# && rm -rf /var/lib/apt/lists/* - -# Copiamos pyproject y lock si lo hubiera -#COPY pyproject.toml ./ - -# Instalamos dependencias -#RUN pip install --upgrade pip && \ -# pip install . - -# Copiamos el resto del código (respetando .dockerignore) -#COPY . . - -# Variables de autenticación básica -#ENV BASIC_AUTH_USERNAME=admin -#ENV BASIC_AUTH_PASSWORD=admin - -#EXPOSE 8000 - -#CMD ["python", "-m", "uvicorn", "beyond_api.main:app", "--host", "0.0.0.0", "--port", "8000"] # --------------------------- # Builder stage # --------------------------- FROM python:3.11-slim AS builder -ENV PYTHONDONTWRITEBYTECODE=1 -ENV PYTHONUNBUFFERED=1 - WORKDIR /app -# Solo para compilar dependencias -RUN apt-get update && apt-get install -y --no-install-recommends \ - build-essential \ - && rm -rf /var/lib/apt/lists/* +# Instalar uv (más rápido que pip) +COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv -# Copiamos archivos de dependencias primero (mejor cache) -COPY pyproject.toml ./ +ENV UV_COMPILE_BYTECODE=1 \ + UV_LINK_MODE=copy -# Creamos wheels (más limpio para producción) -RUN pip install --upgrade pip && \ - pip wheel --no-cache-dir --no-deps --wheel-dir /wheels . +COPY pyproject.toml uv.lock* ./ +# Instalar dependencias con uv +RUN uv sync --frozen --no-install-project --no-dev # --------------------------- # Runtime stage # --------------------------- -FROM python:3.11-slim +FROM python:3.11-alpine -ENV PYTHONDONTWRITEBYTECODE=1 -ENV PYTHONUNBUFFERED=1 +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 \ + PATH="/app/.venv/bin:$PATH" WORKDIR /app -# Crear usuario no-root (mejor seguridad) -RUN useradd --create-home appuser +RUN apk add --no-cache libstdc++ && \ + adduser -D -h /app appuser -# Copiar wheels generados -COPY --from=builder /wheels /wheels - -# Instalar dependencias sin herramientas de compilación -RUN pip install --upgrade pip && \ - pip install --no-cache-dir /wheels/* && \ - rm -rf /wheels +# Copiar virtualenv +COPY --from=builder /app/.venv /app/.venv # Copiar código -COPY . . - -# Cambiar propietario -RUN chown -R appuser:appuser /app +COPY --chown=appuser:appuser ./src ./src +COPY --chown=appuser:appuser ./main.py* ./app.py* ./ USER appuser -ENV BASIC_AUTH_USERNAME=admin -ENV BASIC_AUTH_PASSWORD=admin - EXPOSE 8000 -CMD ["uvicorn", "beyond_api.main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file -- 2.49.1 From b6dc8485c02c139a49e48a3b1d0e018472ffdce2 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Sun, 15 Feb 2026 11:11:36 +0000 Subject: [PATCH 48/65] trying to reduce image size --- backend/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index d64351d..0d26e7c 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -35,11 +35,11 @@ RUN apk add --no-cache libstdc++ && \ COPY --from=builder /app/.venv /app/.venv # Copiar código -COPY --chown=appuser:appuser ./src ./src -COPY --chown=appuser:appuser ./main.py* ./app.py* ./ +COPY --chown=appuser:appuser ./backend ./backend +#COPY --chown=appuser:appuser ./main.py* ./app.py* ./ USER appuser EXPOSE 8000 -CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "beyond_api.main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file -- 2.49.1 From 768e384ed61ed7920b5ce0c2c3b6d0c7f8d31ad4 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Sun, 15 Feb 2026 11:24:09 +0000 Subject: [PATCH 49/65] trying to reduce image size 2 --- backend/Dockerfile | 63 ++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 0d26e7c..057f6e0 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,45 +1,54 @@ - # --------------------------- # Builder stage # --------------------------- FROM python:3.11-slim AS builder - +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 WORKDIR /app +# Solo para compilar dependencias +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + && rm -rf /var/lib/apt/lists/* +# Copiamos archivos de dependencias primero (mejor cache) +COPY pyproject.toml ./ +# Creamos wheels (más limpio para producción) +#RUN pip install --upgrade pip && \ +# pip wheel --no-cache-dir --no-deps --wheel-dir /wheels . -# Instalar uv (más rápido que pip) -COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv +RUN pip install --upgrade pip && \ + pip install --prefix=/install --no-warn-script-location . -ENV UV_COMPILE_BYTECODE=1 \ - UV_LINK_MODE=copy - -COPY pyproject.toml uv.lock* ./ - -# Instalar dependencias con uv -RUN uv sync --frozen --no-install-project --no-dev +RUN find /install -type d -name '__pycache__' -exec rm -rf {} + && \ + find /install -type f -name '*.pyc' -delete && \ + find /install -type f -name '*.pyo' -delete # --------------------------- # Runtime stage # --------------------------- FROM python:3.11-alpine - -ENV PYTHONDONTWRITEBYTECODE=1 \ - PYTHONUNBUFFERED=1 \ - PATH="/app/.venv/bin:$PATH" +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 +ENV PYTHONPATH=/usr/local WORKDIR /app - -RUN apk add --no-cache libstdc++ && \ +# Crear usuario no-root (mejor seguridad) +#RUN useradd --create-home appuser +# Copiar wheels generados +#COPY --from=builder /wheels /wheels +# Instalar dependencias sin herramientas de compilación +#RUN pip install --upgrade pip && \ + pip install --no-cache-dir /wheels/* && \ + rm -rf /wheels +# Copiar código +#COPY . . +# Cambiar propietario +RUN apk add --no-cache libstdc++ libgcc && \ adduser -D -h /app appuser -# Copiar virtualenv -COPY --from=builder /app/.venv /app/.venv - -# Copiar código -COPY --chown=appuser:appuser ./backend ./backend -#COPY --chown=appuser:appuser ./main.py* ./app.py* ./ +COPY --from=builder /install /usr/local +RUN chown -R appuser:appuser /app USER appuser - -EXPOSE 8000 - -CMD ["uvicorn", "beyond_api.main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +ENV BASIC_AUTH_USERNAME=admin +ENV BASIC_AUTH_PASSWORD=admin +EXPOSE 8000 \ No newline at end of file -- 2.49.1 From d6db3d3e70b678ccc27aafbf5be5ae0b6482755a Mon Sep 17 00:00:00 2001 From: Guillermo Date: Sun, 15 Feb 2026 11:28:20 +0000 Subject: [PATCH 50/65] trying to reduce image size 2 fix typo --- backend/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 057f6e0..ad9e591 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -37,8 +37,8 @@ WORKDIR /app #COPY --from=builder /wheels /wheels # Instalar dependencias sin herramientas de compilación #RUN pip install --upgrade pip && \ - pip install --no-cache-dir /wheels/* && \ - rm -rf /wheels +# pip install --no-cache-dir /wheels/* && \ +# rm -rf /wheels # Copiar código #COPY . . # Cambiar propietario -- 2.49.1 From 5707b1fbc4941a0a743c61e0308fbca488ea4198 Mon Sep 17 00:00:00 2001 From: garbelo Date: Sun, 15 Feb 2026 15:01:52 +0000 Subject: [PATCH 51/65] back to original --- backend/Dockerfile | 59 ++++++++++++++-------------------------------- 1 file changed, 18 insertions(+), 41 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index ad9e591..88c0b4e 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,54 +1,31 @@ -# --------------------------- -# Builder stage -# --------------------------- -FROM python:3.11-slim AS builder +# backend/Dockerfile +FROM python:3.11-slim + +# Evitar .pyc y buffering ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 + WORKDIR /app -# Solo para compilar dependencias + +# Dependencias del sistema mínimas RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ && rm -rf /var/lib/apt/lists/* -# Copiamos archivos de dependencias primero (mejor cache) + +# Copiamos pyproject y lock si lo hubiera COPY pyproject.toml ./ -# Creamos wheels (más limpio para producción) -#RUN pip install --upgrade pip && \ -# pip wheel --no-cache-dir --no-deps --wheel-dir /wheels . +# Instalamos dependencias RUN pip install --upgrade pip && \ - pip install --prefix=/install --no-warn-script-location . + pip install . -RUN find /install -type d -name '__pycache__' -exec rm -rf {} + && \ - find /install -type f -name '*.pyc' -delete && \ - find /install -type f -name '*.pyo' -delete +# Copiamos el resto del código (respetando .dockerignore) +COPY . . -# --------------------------- -# Runtime stage -# --------------------------- -FROM python:3.11-alpine -ENV PYTHONDONTWRITEBYTECODE=1 -ENV PYTHONUNBUFFERED=1 -ENV PYTHONPATH=/usr/local - -WORKDIR /app -# Crear usuario no-root (mejor seguridad) -#RUN useradd --create-home appuser -# Copiar wheels generados -#COPY --from=builder /wheels /wheels -# Instalar dependencias sin herramientas de compilación -#RUN pip install --upgrade pip && \ -# pip install --no-cache-dir /wheels/* && \ -# rm -rf /wheels -# Copiar código -#COPY . . -# Cambiar propietario -RUN apk add --no-cache libstdc++ libgcc && \ - adduser -D -h /app appuser - -COPY --from=builder /install /usr/local - -RUN chown -R appuser:appuser /app -USER appuser +# Variables de autenticación básica ENV BASIC_AUTH_USERNAME=admin ENV BASIC_AUTH_PASSWORD=admin -EXPOSE 8000 \ No newline at end of file + +EXPOSE 8000 + +CMD ["python", "-m", "uvicorn", "beyond_api.main:app", "--host", "0.0.0.0", "--port", "8000"] -- 2.49.1 From 1030fa994c168eaea6e09ae388368d886d880e93 Mon Sep 17 00:00:00 2001 From: garbelo Date: Sun, 15 Feb 2026 15:08:25 +0000 Subject: [PATCH 52/65] =?UTF-8?q?Reducci=C3=B3n=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/Dockerfile | 47 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 88c0b4e..8cba572 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,31 +1,58 @@ -# backend/Dockerfile -FROM python:3.11-slim +# --------------------------- +# 1️⃣ Builder stage +# --------------------------- +FROM python:3.11-slim AS builder -# Evitar .pyc y buffering ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 WORKDIR /app -# Dependencias del sistema mínimas +# Solo herramientas necesarias para compilar dependencias RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ && rm -rf /var/lib/apt/lists/* -# Copiamos pyproject y lock si lo hubiera +# Copiamos solo archivos de dependencias (mejor cache) COPY pyproject.toml ./ -# Instalamos dependencias +# Generamos wheels RUN pip install --upgrade pip && \ - pip install . + pip wheel --no-cache-dir --no-deps --wheel-dir /wheels . -# Copiamos el resto del código (respetando .dockerignore) + +# --------------------------- +# 2️⃣ Runtime stage +# --------------------------- +FROM python:3.11-slim + +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 + +WORKDIR /app + +# Crear usuario no-root +RUN useradd --create-home appuser + +# Copiar wheels desde builder +COPY --from=builder /wheels /wheels + +# Instalar dependencias sin compilers +RUN pip install --upgrade pip && \ + pip install --no-cache-dir /wheels/* && \ + rm -rf /wheels + +# Copiar código fuente COPY . . -# Variables de autenticación básica +# Cambiar permisos +RUN chown -R appuser:appuser /app + +USER appuser + ENV BASIC_AUTH_USERNAME=admin ENV BASIC_AUTH_PASSWORD=admin EXPOSE 8000 -CMD ["python", "-m", "uvicorn", "beyond_api.main:app", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "beyond_api.main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file -- 2.49.1 From c633124454cfe6ea41566a168530b2cbdc058cc7 Mon Sep 17 00:00:00 2001 From: garbelo Date: Sun, 15 Feb 2026 15:08:56 +0000 Subject: [PATCH 53/65] Reduccion 1 --- backend/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 8cba572..7f76f6a 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,5 +1,5 @@ # --------------------------- -# 1️⃣ Builder stage +# Builder stage # --------------------------- FROM python:3.11-slim AS builder @@ -22,7 +22,7 @@ RUN pip install --upgrade pip && \ # --------------------------- -# 2️⃣ Runtime stage +# Runtime stage # --------------------------- FROM python:3.11-slim -- 2.49.1 From 1a682c121ee21b963ebe857c42c43d8e3df0dc92 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Mon, 16 Feb 2026 14:44:43 +0000 Subject: [PATCH 54/65] reduced at 468 --- backend/Dockerfile | 50 +++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 7f76f6a..09e3efc 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,58 +1,50 @@ # --------------------------- # Builder stage # --------------------------- -FROM python:3.11-slim AS builder - -ENV PYTHONDONTWRITEBYTECODE=1 -ENV PYTHONUNBUFFERED=1 - -WORKDIR /app +FROM python:3.13-bookworm AS builder # Solo herramientas necesarias para compilar dependencias RUN apt-get update && apt-get install -y --no-install-recommends \ - build-essential \ - && rm -rf /var/lib/apt/lists/* + build-essential && apt-get clean && rm -rf /var/lib/apt/lists/* + +ADD https://astral.sh/uv/install.sh /install.sh +RUN chmod -R 655 /install.sh && /install.sh && rm /install.sh + +ENV PATH="/root/.local/bin:$PATH" + +WORKDIR /app # Copiamos solo archivos de dependencias (mejor cache) COPY pyproject.toml ./ -# Generamos wheels -RUN pip install --upgrade pip && \ - pip wheel --no-cache-dir --no-deps --wheel-dir /wheels . - +# Cambiamos pip por uv más moderno y rápido +RUN uv sync # --------------------------- # Runtime stage # --------------------------- -FROM python:3.11-slim +FROM python:3.13-slim-bookworm AS production -ENV PYTHONDONTWRITEBYTECODE=1 -ENV PYTHONUNBUFFERED=1 + +ENV BASIC_AUTH_USERNAME=admin +ENV BASIC_AUTH_PASSWORD=admin WORKDIR /app # Crear usuario no-root RUN useradd --create-home appuser -# Copiar wheels desde builder -COPY --from=builder /wheels /wheels +# Copiamos código y producto uv -# Instalar dependencias sin compilers -RUN pip install --upgrade pip && \ - pip install --no-cache-dir /wheels/* && \ - rm -rf /wheels - -# Copiar código fuente COPY . . +COPY --from=builder /app/.venv .venv # Cambiar permisos -RUN chown -R appuser:appuser /app +#RUN chown -R appuser:appuser /app -USER appuser - -ENV BASIC_AUTH_USERNAME=admin -ENV BASIC_AUTH_PASSWORD=admin +#USER appuser +ENV PATH="/app/.venv/bin:$PATH" EXPOSE 8000 -CMD ["uvicorn", "beyond_api.main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "beyond_api.main:app", "--host", "0.0.0.0", "--port", "8000"] -- 2.49.1 From c25c6c29162fb9cca14aedf84c8f57ab10000299 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Mon, 16 Feb 2026 16:17:26 +0000 Subject: [PATCH 55/65] action for tag creation --- .gitea/workflows/tag.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .gitea/workflows/tag.yaml diff --git a/.gitea/workflows/tag.yaml b/.gitea/workflows/tag.yaml new file mode 100644 index 0000000..b5119fc --- /dev/null +++ b/.gitea/workflows/tag.yaml @@ -0,0 +1,12 @@ +name: Tag Release + +on: + - create + +jobs: + create new images with tag: + runs-on: ubuntu-latest + steps: + + - name: Extract Branch Name + run: echo "${{ gitea.ref }}" ; -- 2.49.1 From 1976432a95982ea4109b53ca83699288479f3f05 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Mon, 16 Feb 2026 16:50:00 +0000 Subject: [PATCH 56/65] Changing workflows triggers --- .gitea/workflows/example.yaml | 17 ++++++++++------- .gitea/workflows/tag.yaml | 9 ++++++--- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index a4debb9..4bb159b 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -1,11 +1,13 @@ name: Workflow de prueba on: - - push + pull_request_review: + types: [submitted] + env: DOCKER_ORG: beyondcx - BRANCH_NAME: proxy + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} jobs: Build and push images: @@ -14,12 +16,13 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Extract Branch Name - run: echo "${{ gitea.ref }}" ; - echo "${{ gitea.ref }}" | sed 's|refs/heads/||' ; + - name: Extract Tag Name + uses: olegtarasov/get-tag@v2.1.4 + id: tagName + + - name: Echo branch name + run: echo "${{ env.BRANCH_NAME }}" - echo ${{ env.BRANCH_NAME }} - #- name: Setup QEMU # uses: docker/setup-qemu-action@v3 diff --git a/.gitea/workflows/tag.yaml b/.gitea/workflows/tag.yaml index b5119fc..6a75550 100644 --- a/.gitea/workflows/tag.yaml +++ b/.gitea/workflows/tag.yaml @@ -1,12 +1,15 @@ name: Tag Release on: - - create + release: + types: [created,edited,published] jobs: create new images with tag: runs-on: ubuntu-latest steps: - - name: Extract Branch Name - run: echo "${{ gitea.ref }}" ; + - name: Extract Tag Name + uses: olegtarasov/get-tag@v2.1.4 + id: tagName + run: echo "$GIT_TAG_NAME"; -- 2.49.1 From 8c2ffaae55b049636e0f0e4ca9a8ba826047c95b Mon Sep 17 00:00:00 2001 From: garbelo Date: Mon, 16 Feb 2026 16:57:23 +0000 Subject: [PATCH 57/65] typo? --- .gitea/workflows/tag.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitea/workflows/tag.yaml b/.gitea/workflows/tag.yaml index 6a75550..ef76bab 100644 --- a/.gitea/workflows/tag.yaml +++ b/.gitea/workflows/tag.yaml @@ -5,10 +5,9 @@ on: types: [created,edited,published] jobs: - create new images with tag: + new images: runs-on: ubuntu-latest steps: - - name: Extract Tag Name uses: olegtarasov/get-tag@v2.1.4 id: tagName -- 2.49.1 From 01853b41ba62bd1ca2c0865e0c85bd4e081e8156 Mon Sep 17 00:00:00 2001 From: garbelo Date: Mon, 16 Feb 2026 16:59:16 +0000 Subject: [PATCH 58/65] two steps --- .gitea/workflows/tag.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/tag.yaml b/.gitea/workflows/tag.yaml index ef76bab..551182d 100644 --- a/.gitea/workflows/tag.yaml +++ b/.gitea/workflows/tag.yaml @@ -10,5 +10,6 @@ jobs: steps: - name: Extract Tag Name uses: olegtarasov/get-tag@v2.1.4 - id: tagName + id: tagName + - name: Show tag run: echo "$GIT_TAG_NAME"; -- 2.49.1 From 7a931d32bab75b20cf9eba2837b4fc064eddb438 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Tue, 17 Feb 2026 10:39:24 +0000 Subject: [PATCH 59/65] Update actions --- .gitea/workflows/example.yaml | 14 ++------------ .gitea/workflows/tag.yaml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/example.yaml b/.gitea/workflows/example.yaml index 4bb159b..9c59524 100644 --- a/.gitea/workflows/example.yaml +++ b/.gitea/workflows/example.yaml @@ -16,16 +16,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Extract Tag Name - uses: olegtarasov/get-tag@v2.1.4 - id: tagName - - - name: Echo branch name - run: echo "${{ env.BRANCH_NAME }}" - - #- name: Setup QEMU - # uses: docker/setup-qemu-action@v3 - - name: Setup Buildx uses: docker/setup-buildx-action@v3 with: @@ -45,7 +35,7 @@ jobs: uses: docker/build-push-action@v5 with: context: frontend - push: true + push: false tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/frontend-analytics-demo:${{ env.BRANCH_NAME }} platforms: linux/amd64 file: frontend/Dockerfile @@ -54,7 +44,7 @@ jobs: uses: docker/build-push-action@v5 with: context: backend - push: true + push: false tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/backend-analytics-demo:${{ env.BRANCH_NAME }} platforms: linux/amd64 file: backend/Dockerfile diff --git a/.gitea/workflows/tag.yaml b/.gitea/workflows/tag.yaml index 551182d..9400c54 100644 --- a/.gitea/workflows/tag.yaml +++ b/.gitea/workflows/tag.yaml @@ -13,3 +13,37 @@ jobs: id: tagName - name: Show tag run: echo "$GIT_TAG_NAME"; + + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Buildx + uses: docker/setup-buildx-action@v3 + with: + driver-opts: network=host + + - name: Login to Registry + uses: docker/login-action@v3 + with: + registry: ${{ secrets.REGISTRY_URL }} + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PWD }} + + - name: Build frontend and push it to registry + uses: docker/build-push-action@v5 + with: + context: frontend + push: true + tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/frontend-analytics-demo:$GIT_TAG_NAME + platforms: linux/amd64 + file: frontend/Dockerfile + + - name: Build backend and push it to registry + uses: docker/build-push-action@v5 + with: + context: backend + push: true + tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/backend-analytics-demo:$GIT_TAG_NAME + platforms: linux/amd64 + file: backend/Dockerfile + -- 2.49.1 From 4cd49d8c9aced015ac46524f2f2982cd9633f36c Mon Sep 17 00:00:00 2001 From: Guillermo Date: Tue, 17 Feb 2026 10:42:21 +0000 Subject: [PATCH 60/65] change docker image tag build process --- .gitea/workflows/tag.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/tag.yaml b/.gitea/workflows/tag.yaml index 9400c54..a924896 100644 --- a/.gitea/workflows/tag.yaml +++ b/.gitea/workflows/tag.yaml @@ -34,7 +34,7 @@ jobs: with: context: frontend push: true - tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/frontend-analytics-demo:$GIT_TAG_NAME + tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/frontend-analytics-demo:${{ GIT_TAG_NAME }} platforms: linux/amd64 file: frontend/Dockerfile -- 2.49.1 From 3ea406044bd8481aa21d29c3168582a5b554803c Mon Sep 17 00:00:00 2001 From: Guillermo Date: Tue, 17 Feb 2026 10:47:11 +0000 Subject: [PATCH 61/65] change docker image tag build process --- .gitea/workflows/tag.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/tag.yaml b/.gitea/workflows/tag.yaml index a924896..7d153d6 100644 --- a/.gitea/workflows/tag.yaml +++ b/.gitea/workflows/tag.yaml @@ -34,7 +34,7 @@ jobs: with: context: frontend push: true - tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/frontend-analytics-demo:${{ GIT_TAG_NAME }} + tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/frontend-analytics-demo:${{ step.tagName.outputs.tag }} platforms: linux/amd64 file: frontend/Dockerfile @@ -43,7 +43,7 @@ jobs: with: context: backend push: true - tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/backend-analytics-demo:$GIT_TAG_NAME + tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/backend-analytics-demo:${{ step.tagName.outputs.tag }} platforms: linux/amd64 file: backend/Dockerfile -- 2.49.1 From 5b3bd631cbad8fd764838ce5108654fe8319df14 Mon Sep 17 00:00:00 2001 From: garbelo Date: Tue, 17 Feb 2026 10:50:41 +0000 Subject: [PATCH 62/65] typo fixed --- .gitea/workflows/tag.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/tag.yaml b/.gitea/workflows/tag.yaml index 7d153d6..a6c6049 100644 --- a/.gitea/workflows/tag.yaml +++ b/.gitea/workflows/tag.yaml @@ -34,7 +34,7 @@ jobs: with: context: frontend push: true - tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/frontend-analytics-demo:${{ step.tagName.outputs.tag }} + tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/frontend-analytics-demo:${{ steps.tagName.outputs.tag }} platforms: linux/amd64 file: frontend/Dockerfile @@ -43,7 +43,7 @@ jobs: with: context: backend push: true - tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/backend-analytics-demo:${{ step.tagName.outputs.tag }} + tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/backend-analytics-demo:${{ steps.tagName.outputs.tag }} platforms: linux/amd64 file: backend/Dockerfile -- 2.49.1 From 15ed12f0c6266d253d654f2fbb5ed727c939508b Mon Sep 17 00:00:00 2001 From: Guillermo Date: Tue, 17 Feb 2026 11:07:43 +0000 Subject: [PATCH 63/65] wrong copy and paste --- .gitea/workflows/tag.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitea/workflows/tag.yaml b/.gitea/workflows/tag.yaml index a6c6049..58003fe 100644 --- a/.gitea/workflows/tag.yaml +++ b/.gitea/workflows/tag.yaml @@ -4,6 +4,9 @@ on: release: types: [created,edited,published] +env: + DOCKER_ORG: beyondcx + jobs: new images: runs-on: ubuntu-latest -- 2.49.1 From 044434c6423174e6eb0dcec0c804cf22957c5651 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Tue, 17 Feb 2026 16:10:17 +0000 Subject: [PATCH 64/65] New Worflow deploy --- .gitea/workflows/deploy.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .gitea/workflows/deploy.yaml diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..b50beab --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,21 @@ +name: Deploy solution + +on: + workflow_dispatch: + inputs: + domain: + description: 'Seleccione destino:' + required: true + default: 'demo.analytics.beyondcx.org' + tag: + description: 'Indique el tag/release' + required: true + default: 'latest' + + + +jobs: + log-the-inputs: + runs-on: ubuntu-latest + steps: + - run: echo "${{ inputs.domain }} con la imagen ${{ inputs.tag }}" -- 2.49.1 From 081ff7a3318af122f40848a024598b1c85dd174e Mon Sep 17 00:00:00 2001 From: Guillermo Date: Tue, 17 Feb 2026 16:48:44 +0000 Subject: [PATCH 65/65] script t parse the docker compose template with some values requested to the user --- generate_compose.sh | 114 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100755 generate_compose.sh diff --git a/generate_compose.sh b/generate_compose.sh new file mode 100755 index 0000000..993ecdf --- /dev/null +++ b/generate_compose.sh @@ -0,0 +1,114 @@ +#!/usr/bin/env bash +set -euo pipefail + +############################################### +# CONFIGURACIÓN BÁSICA – EDITA ESTO +############################################### +# TODO: pon aquí la URL real de tu repo (sin credenciales) +REPO_URL_DEFAULT="ssh://git@git.beyondcx.org:2424/susana/BeyondCXAnalytics-Demo.git" +INSTALL_BASE="/opt/beyondcx" + +############################################### +# UTILIDADES +############################################### +step() { + echo + echo "==================================================" + echo " 👉 $1" + echo "==================================================" +} + + +############################################### +# 1. COMPROBACIONES INICIALES +############################################### + +step "Recogiendo datos de configuración" + +read -rp "Dominio para la aplicación (ej: app.cliente.com): " DOMAIN +if [ -z "$DOMAIN" ]; then + echo "El dominio no puede estar vacío." + exit 1 +fi + +SUBDOMAIN=${DOMAIN%%.*} +if [[ $DOMAIN == $SUBDOMAIN ]]; then + DOMAIN=$DOMAIN".analytics.beyondcx.org" +fi +echo "el dominio es $DOMAIN y el subdominio $SUBDOMAIN" + +INSTALL_DIR=$INSTALL_BASE"/"$SUBDOMAIN + +read -rp "Usuario de acceso (Basic Auth / login): " API_USER +if [ -z "$API_USER" ]; then + echo "El usuario no puede estar vacío." + exit 1 +fi + +read -rsp "Contraseña de acceso: " API_PASS +echo +if [ -z "$API_PASS" ]; then + echo "La contraseña no puede estar vacía." + exit 1 +fi + +echo +echo "Resumen de configuración:" +echo " Dominio: $DOMAIN" +echo " Usuario API: $API_USER" + +read -rp "¿Continuar con la instalación? [s/N]: " CONFIRM +CONFIRM=${CONFIRM:-N} +if [[ ! "$CONFIRM" =~ ^[sS]$ ]]; then + echo "Instalación cancelada." + exit 0 +fi + +# COMENZAMOS ... + +############################################### +# 4. CONFIGURAR docker-compose.yml (credenciales y nginx) +############################################### +step "Aplicando credenciales al docker-compose.yml" + +if ! grep -q "BASIC_AUTH_USERNAME" docker-compose.yml; then + echo "⚠ No encuentro BASIC_AUTH_USERNAME en docker-compose.yml. Revisa el archivo a mano." +else + sed -i "s/BASIC_AUTH_USERNAME:.*/BASIC_AUTH_USERNAME: \"$API_USER\"/" docker-compose.yml +fi + +if ! grep -q "BASIC_AUTH_PASSWORD" docker-compose.yml; then + echo "⚠ No encuentro BASIC_AUTH_PASSWORD en docker-compose.yml. Revisa el archivo a mano." +else + sed -i "s/BASIC_AUTH_PASSWORD:.*/BASIC_AUTH_PASSWORD: \"$API_PASS\"/" docker-compose.yml +fi + +if ! grep -q "XXX" docker-compose.yml; then + echo "⚠ No encuentro XXX en docker-compose.yml. Revisa el archivo a mano." +else + sed -i "s/XXX/$SUBDOMAIN/g" docker-compose.yml +fi +if [[ $DOMAIN == $SUBDOMAIN ]]; then + set DOMAIN=$DOMAIN".analytics.beyondcx.org" +fi +if ! grep -q "DDD" docker-compose.yml; then + echo "⚠ No encuentro DDD en docker-compose.yml. Revisa el archivo a mano." +else + sed -i "s/DDD/$DOMAIN/" docker-compose.yml +fi + + + +step "Arrancando contenedores" + +docker compose up -d + +############################################### +# 8. FIN +############################################### +step "Instalación completada" + +echo "La aplicación debería estar disponible en: https://$DOMAIN" +echo +echo "Servicios levantados:" +docker compose ps -- 2.49.1