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 <qwen-coder@alibabacloud.com>
This commit is contained in:
2026-03-27 10:50:14 -03:00
parent 3ef1a73b95
commit a203a82038
2 changed files with 11 additions and 6 deletions
+5
View File
@@ -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
+6 -6
View File
@@ -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"