Feat: Actualizar homepage con branding RioCata y ajustar configuración
Some checks failed
build-and-deploy / build-and-deploy (push) Failing after 2m16s
Some checks failed
build-and-deploy / build-and-deploy (push) Failing after 2m16s
This commit is contained in:
20
.env.example
20
.env.example
@@ -10,22 +10,32 @@
|
||||
# REGISTRY & DEPLOYMENT
|
||||
# ===========================================
|
||||
# URL del registro Docker (sin http:// ni https://)
|
||||
# Para registry de Gitea: gitea.ejemplo.com
|
||||
# Para registry de Gitea: gitea.nucleoriofrio.com
|
||||
# El owner del repositorio se agrega automáticamente en el workflow
|
||||
# Imagen final: REGISTRY_URL/owner/APP_NAME:latest
|
||||
REGISTRY_URL=gitea.ejemplo.com
|
||||
REGISTRY_URL=gitea.nucleoriofrio.com
|
||||
|
||||
# Nombre de la aplicación (usado para container, imagen, y labels de Traefik)
|
||||
APP_NAME=mi-app
|
||||
APP_NAME=riocata
|
||||
|
||||
# Dominio donde se desplegará la aplicación
|
||||
APP_DOMAIN=miapp.ejemplo.com
|
||||
APP_DOMAIN=riocata.nucleoriofrio.com
|
||||
|
||||
# ===========================================
|
||||
# APPLICATION
|
||||
# ===========================================
|
||||
# URL pública de la aplicación
|
||||
NUXT_PUBLIC_APP_URL=https://miapp.ejemplo.com
|
||||
NUXT_PUBLIC_APP_URL=https://riocata.nucleoriofrio.com
|
||||
|
||||
# ===========================================
|
||||
# DATABASE
|
||||
# ===========================================
|
||||
# Base de datos PostgreSQL
|
||||
POSTGRES_DB=riocata
|
||||
POSTGRES_USER=riocata_user
|
||||
|
||||
# Contraseña de PostgreSQL (SECRETO)
|
||||
POSTGRES_PASSWORD=cambiar-en-produccion
|
||||
|
||||
# ===========================================
|
||||
# REGISTRY AUTHENTICATION (solo para CI/CD)
|
||||
|
||||
@@ -5,56 +5,57 @@ on:
|
||||
branches: [ main, master ]
|
||||
|
||||
jobs:
|
||||
#───────────────── build & push ─────────────────
|
||||
build:
|
||||
runs-on: docker
|
||||
env:
|
||||
REG: ${{ vars.REGISTRY_URL }}
|
||||
APP_NAME: ${{ vars.APP_NAME }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: docker/setup-buildx-action@v2
|
||||
- uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${{ vars.REGISTRY_URL }}
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Build+push ${{ vars.APP_NAME }}
|
||||
run: |
|
||||
cd nuxt4
|
||||
docker build -t $REG/${{ github.repository_owner }}/$APP_NAME:${{ github.sha }} -t $REG/${{ github.repository_owner }}/$APP_NAME:latest .
|
||||
docker push $REG/${{ github.repository_owner }}/$APP_NAME:${{ github.sha }}
|
||||
docker push $REG/${{ github.repository_owner }}/$APP_NAME:latest
|
||||
|
||||
#───────────────── deploy ─────────────────
|
||||
deploy:
|
||||
needs: build
|
||||
build-and-deploy:
|
||||
runs-on: docker
|
||||
env:
|
||||
REG: ${{ vars.REGISTRY_URL }}
|
||||
REPO_OWNER: ${{ github.repository_owner }}
|
||||
APP_NAME: ${{ vars.APP_NAME }}
|
||||
# Variables de entorno para docker-compose
|
||||
APP_DOMAIN: ${{ vars.APP_DOMAIN }}
|
||||
NUXT_PUBLIC_APP_URL: ${{ vars.NUXT_PUBLIC_APP_URL }}
|
||||
POSTGRES_DB: ${{ vars.POSTGRES_DB }}
|
||||
POSTGRES_USER: ${{ vars.POSTGRES_USER }}
|
||||
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Login to registry
|
||||
run: docker login ${{ vars.REGISTRY_URL }} -u ${{ secrets.REGISTRY_USERNAME }} -p ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Info about environment
|
||||
- name: Build, push y deploy completo
|
||||
run: |
|
||||
echo "ℹ️ Deploying ${{ vars.APP_NAME }}"
|
||||
echo " Domain: ${{ vars.APP_DOMAIN }}"
|
||||
echo " Image: ${{ vars.REGISTRY_URL }}/${{ github.repository_owner }}/${{ vars.APP_NAME }}:latest"
|
||||
echo " Network: principal"
|
||||
set -e
|
||||
|
||||
- name: Pull fresh images used in compose
|
||||
run: docker compose pull
|
||||
echo "📦 Clonando repositorio..."
|
||||
git clone https://${{ github.repository_owner }}:${{ secrets.REGISTRY_PASSWORD }}@${{ vars.REGISTRY_URL }}/${{ github.repository }}.git /tmp/repo
|
||||
cd /tmp/repo
|
||||
git checkout ${{ github.sha }}
|
||||
|
||||
- name: Clean up stack
|
||||
run: docker compose --project-name $APP_NAME down
|
||||
echo "🔐 Login al registry..."
|
||||
docker login ${{ vars.REGISTRY_URL }} -u ${{ secrets.REGISTRY_USERNAME }} -p ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Update stack
|
||||
run: docker compose --project-name $APP_NAME up -d --remove-orphans --wait
|
||||
echo "🏗️ Construyendo imagen de Nuxt..."
|
||||
cd nuxt4
|
||||
docker build -t $REG/$REPO_OWNER/$APP_NAME:${{ github.sha }} -t $REG/$REPO_OWNER/$APP_NAME:latest .
|
||||
|
||||
echo "📤 Subiendo imágenes..."
|
||||
docker push $REG/$REPO_OWNER/$APP_NAME:${{ github.sha }}
|
||||
docker push $REG/$REPO_OWNER/$APP_NAME:latest
|
||||
|
||||
echo "ℹ️ Información de despliegue:"
|
||||
echo " App: $APP_NAME"
|
||||
echo " Domain: $APP_DOMAIN"
|
||||
echo " Image: $REG/$REPO_OWNER/$APP_NAME:latest"
|
||||
echo " Networks: principal, traefik-network"
|
||||
|
||||
cd /tmp/repo
|
||||
|
||||
echo "🔄 Descargando imágenes actualizadas..."
|
||||
docker compose pull
|
||||
|
||||
echo "🧹 Limpiando stack anterior..."
|
||||
docker compose --project-name $APP_NAME down
|
||||
|
||||
echo "🚀 Desplegando stack actualizado..."
|
||||
docker compose --project-name $APP_NAME up -d --remove-orphans --wait
|
||||
|
||||
echo "✅ Despliegue completado exitosamente!"
|
||||
|
||||
echo "🧼 Limpiando archivos temporales..."
|
||||
cd /
|
||||
rm -rf /tmp/repo
|
||||
|
||||
@@ -1,10 +1,33 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: ${APP_NAME}_postgres
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- POSTGRES_DB=${POSTGRES_DB:-riocata}
|
||||
- POSTGRES_USER=${POSTGRES_USER:-riocata_user}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- PGDATA=/var/lib/postgresql/data/pgdata
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./postgres/init:/docker-entrypoint-initdb.d:ro
|
||||
networks:
|
||||
- principal
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-riocata_user} -d ${POSTGRES_DB:-riocata}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
app:
|
||||
image: ${REG}/${REPO_OWNER}/${APP_NAME}:latest
|
||||
container_name: ${APP_NAME}
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
# Node Environment
|
||||
- NODE_ENV=production
|
||||
@@ -12,6 +35,13 @@ services:
|
||||
- NUXT_PORT=3000
|
||||
# Public URL
|
||||
- NUXT_PUBLIC_APP_URL=${NUXT_PUBLIC_APP_URL}
|
||||
# Database Connection
|
||||
- DATABASE_URL=postgresql://${POSTGRES_USER:-riocata_user}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-riocata}
|
||||
- POSTGRES_HOST=postgres
|
||||
- POSTGRES_PORT=5432
|
||||
- POSTGRES_DB=${POSTGRES_DB:-riocata}
|
||||
- POSTGRES_USER=${POSTGRES_USER:-riocata_user}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
networks:
|
||||
- principal
|
||||
- traefik-network
|
||||
@@ -48,6 +78,10 @@ services:
|
||||
- "traefik.http.middlewares.${APP_NAME}-cors.headers.accesscontrolmaxage=100"
|
||||
- "traefik.http.middlewares.${APP_NAME}-cors.headers.addvaryheader=true"
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
name: ${APP_NAME}_postgres_data
|
||||
|
||||
networks:
|
||||
principal:
|
||||
external: true
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
<div class="space-y-6">
|
||||
<!-- Header -->
|
||||
<div class="text-center mb-8">
|
||||
<h1 class="text-4xl font-bold mb-2">Plantilla Nuxt + Authentik</h1>
|
||||
<h1 class="text-4xl font-bold mb-2">RioCata</h1>
|
||||
<p class="text-gray-600 dark:text-gray-400">
|
||||
Ejemplo de integración con Authentik Proxy Outpost
|
||||
Sistema de Catastro del Río - Gestión Integral
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user