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
|
# REGISTRY & DEPLOYMENT
|
||||||
# ===========================================
|
# ===========================================
|
||||||
# URL del registro Docker (sin http:// ni https://)
|
# 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
|
# El owner del repositorio se agrega automáticamente en el workflow
|
||||||
# Imagen final: REGISTRY_URL/owner/APP_NAME:latest
|
# 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)
|
# 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
|
# Dominio donde se desplegará la aplicación
|
||||||
APP_DOMAIN=miapp.ejemplo.com
|
APP_DOMAIN=riocata.nucleoriofrio.com
|
||||||
|
|
||||||
# ===========================================
|
# ===========================================
|
||||||
# APPLICATION
|
# APPLICATION
|
||||||
# ===========================================
|
# ===========================================
|
||||||
# URL pública de la aplicación
|
# 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)
|
# REGISTRY AUTHENTICATION (solo para CI/CD)
|
||||||
|
|||||||
@@ -5,56 +5,57 @@ on:
|
|||||||
branches: [ main, master ]
|
branches: [ main, master ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
#───────────────── build & push ─────────────────
|
build-and-deploy:
|
||||||
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
|
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
env:
|
env:
|
||||||
REG: ${{ vars.REGISTRY_URL }}
|
REG: ${{ vars.REGISTRY_URL }}
|
||||||
REPO_OWNER: ${{ github.repository_owner }}
|
REPO_OWNER: ${{ github.repository_owner }}
|
||||||
APP_NAME: ${{ vars.APP_NAME }}
|
APP_NAME: ${{ vars.APP_NAME }}
|
||||||
# Variables de entorno para docker-compose
|
|
||||||
APP_DOMAIN: ${{ vars.APP_DOMAIN }}
|
APP_DOMAIN: ${{ vars.APP_DOMAIN }}
|
||||||
NUXT_PUBLIC_APP_URL: ${{ vars.NUXT_PUBLIC_APP_URL }}
|
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:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Build, push y deploy completo
|
||||||
- name: Login to registry
|
|
||||||
run: docker login ${{ vars.REGISTRY_URL }} -u ${{ secrets.REGISTRY_USERNAME }} -p ${{ secrets.REGISTRY_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Info about environment
|
|
||||||
run: |
|
run: |
|
||||||
echo "ℹ️ Deploying ${{ vars.APP_NAME }}"
|
set -e
|
||||||
echo " Domain: ${{ vars.APP_DOMAIN }}"
|
|
||||||
echo " Image: ${{ vars.REGISTRY_URL }}/${{ github.repository_owner }}/${{ vars.APP_NAME }}:latest"
|
|
||||||
echo " Network: principal"
|
|
||||||
|
|
||||||
- name: Pull fresh images used in compose
|
echo "📦 Clonando repositorio..."
|
||||||
run: docker compose pull
|
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
|
echo "🔐 Login al registry..."
|
||||||
run: docker compose --project-name $APP_NAME down
|
docker login ${{ vars.REGISTRY_URL }} -u ${{ secrets.REGISTRY_USERNAME }} -p ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
- name: Update stack
|
echo "🏗️ Construyendo imagen de Nuxt..."
|
||||||
run: docker compose --project-name $APP_NAME up -d --remove-orphans --wait
|
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'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
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:
|
app:
|
||||||
image: ${REG}/${REPO_OWNER}/${APP_NAME}:latest
|
image: ${REG}/${REPO_OWNER}/${APP_NAME}:latest
|
||||||
container_name: ${APP_NAME}
|
container_name: ${APP_NAME}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
environment:
|
environment:
|
||||||
# Node Environment
|
# Node Environment
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
@@ -12,6 +35,13 @@ services:
|
|||||||
- NUXT_PORT=3000
|
- NUXT_PORT=3000
|
||||||
# Public URL
|
# Public URL
|
||||||
- NUXT_PUBLIC_APP_URL=${NUXT_PUBLIC_APP_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:
|
networks:
|
||||||
- principal
|
- principal
|
||||||
- traefik-network
|
- traefik-network
|
||||||
@@ -48,6 +78,10 @@ services:
|
|||||||
- "traefik.http.middlewares.${APP_NAME}-cors.headers.accesscontrolmaxage=100"
|
- "traefik.http.middlewares.${APP_NAME}-cors.headers.accesscontrolmaxage=100"
|
||||||
- "traefik.http.middlewares.${APP_NAME}-cors.headers.addvaryheader=true"
|
- "traefik.http.middlewares.${APP_NAME}-cors.headers.addvaryheader=true"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
postgres_data:
|
||||||
|
name: ${APP_NAME}_postgres_data
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
principal:
|
principal:
|
||||||
external: true
|
external: true
|
||||||
|
|||||||
@@ -7,9 +7,9 @@
|
|||||||
<div class="space-y-6">
|
<div class="space-y-6">
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<div class="text-center mb-8">
|
<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">
|
<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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user