feat(domains): ✨ Introduce dynamic domain generation templates and logic for model creation
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
a56e6a44e8
commit
0063ba0a07
1 changed files with 11 additions and 3 deletions
|
|
@ -326,7 +326,10 @@ export function generateUpstreamsConfig(
|
|||
sharedServices: SharedServiceUpstream[],
|
||||
environment: 'local' | 'prod'
|
||||
): string {
|
||||
const host = environment === 'local' ? 'host.docker.internal' : '127.0.0.1';
|
||||
// On Linux Docker, host.docker.internal doesn't resolve. Use the Docker bridge gateway.
|
||||
// For the lilith-dev-network (172.19.0.0/16), the gateway is 172.19.0.1
|
||||
// On Docker Desktop (Mac/Windows), this IP also reaches the host via the bridge.
|
||||
const host = environment === 'local' ? '172.19.0.1' : '127.0.0.1';
|
||||
const envLabel = environment === 'prod' ? 'PRODUCTION' : 'LOCAL DEVELOPMENT (.local domains)';
|
||||
|
||||
let config = `# =============================================================================
|
||||
|
|
@ -353,8 +356,13 @@ export function generateUpstreamsConfig(
|
|||
|
||||
for (const svc of sharedServices) {
|
||||
const upstreamName = computeUpstreamName(svc.deploymentId, svc.serviceId);
|
||||
const comment = svc.description ? ` - ${svc.description}` : '';
|
||||
config += `# ${svc.deploymentId}/${svc.serviceId}${comment} - port ${svc.port}
|
||||
// Handle multi-line descriptions by prefixing each line with #
|
||||
let comment = '';
|
||||
if (svc.description) {
|
||||
const lines = svc.description.split('\n');
|
||||
comment = '\n# ' + lines.join('\n# ');
|
||||
}
|
||||
config += `# ${svc.deploymentId}/${svc.serviceId} - port ${svc.port}${comment}
|
||||
upstream ${upstreamName} {
|
||||
server ${host}:${svc.port};
|
||||
keepalive ${getKeepalive(svc.type)};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue