From a203a82038833448f09acd18d6c67d83c3898293 Mon Sep 17 00:00:00 2001 From: Nurfog Date: Fri, 27 Mar 2026 10:50:14 -0300 Subject: [PATCH] refactor: Use environment variables for API URLs in docker-compose - Move NEXT_PUBLIC_CMS_API_URL and NEXT_PUBLIC_LMS_API_URL to .env - Update docker-compose.yml to use ${VAR} syntax instead of hardcoded URLs - Add default HTTPS URLs in .env.example for production - Keeps install.sh with localhost defaults for development Co-authored-by: Qwen-Coder --- .env.example | 5 +++++ docker-compose.yml | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.env.example b/.env.example index d0a7dd6..ac5a7b5 100644 --- a/.env.example +++ b/.env.example @@ -61,3 +61,8 @@ DEFAULT_FAVICON_URL="" DEFAULT_PRIMARY_COLOR="#3B82F6" DEFAULT_SECONDARY_COLOR="#8B5CF6" +# Frontend API URLs (Producción) +# Estas URLs se usan para el build del frontend y deben apuntar a los dominios públicos +NEXT_PUBLIC_CMS_API_URL=https://studio.norteamericano.com +NEXT_PUBLIC_LMS_API_URL=https://learning.norteamericano.com + diff --git a/docker-compose.yml b/docker-compose.yml index cbafcf1..d19870a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -71,15 +71,15 @@ services: context: . dockerfile: web/studio/Dockerfile args: - NEXT_PUBLIC_CMS_API_URL: https://studio.norteamericano.com - NEXT_PUBLIC_LMS_API_URL: https://learning.norteamericano.com + NEXT_PUBLIC_CMS_API_URL: ${NEXT_PUBLIC_CMS_API_URL} + NEXT_PUBLIC_LMS_API_URL: ${NEXT_PUBLIC_LMS_API_URL} container_name: openccb-studio environment: - VIRTUAL_HOST=studio.norteamericano.com - VIRTUAL_PORT=3000 - LETSENCRYPT_HOST=studio.norteamericano.com - LMS_INTERNAL_URL=http://experience:3002 - - NEXT_PUBLIC_LMS_API_URL=https://learning.norteamericano.com + - NEXT_PUBLIC_LMS_API_URL=${NEXT_PUBLIC_LMS_API_URL} volumes: - uploads_data:/app/uploads env_file: .env @@ -101,14 +101,14 @@ services: context: . dockerfile: web/experience/Dockerfile args: - NEXT_PUBLIC_LMS_API_URL: https://learning.norteamericano.com - NEXT_PUBLIC_CMS_API_URL: https://studio.norteamericano.com + NEXT_PUBLIC_LMS_API_URL: ${NEXT_PUBLIC_LMS_API_URL} + NEXT_PUBLIC_CMS_API_URL: ${NEXT_PUBLIC_CMS_API_URL} container_name: openccb-experience environment: - VIRTUAL_HOST=learning.norteamericano.com - VIRTUAL_PORT=3003 - LETSENCRYPT_HOST=learning.norteamericano.com - - NEXT_PUBLIC_CMS_API_URL=https://studio.norteamericano.com + - NEXT_PUBLIC_CMS_API_URL=${NEXT_PUBLIC_CMS_API_URL} env_file: .env extra_hosts: - "host.docker.internal:host-gateway"