fix: Magic ENV SERVICE_FQDN_CRM_APP_8000 for auto domain + SSL
This commit is contained in:
@@ -47,6 +47,7 @@ services:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
SERVICE_FQDN_CRM_APP_8000: ${APP_DOMAIN}
|
||||
DATABASE_URL: ${DATABASE_URL:-postgresql+asyncpg://crm_api:${DB_PASSWORD}@postgres:5432/${POSTGRES_DB:-crm_db}}
|
||||
AUTH_DATABASE_URL: ${AUTH_DATABASE_URL:-postgresql+asyncpg://crm_auth:${DB_PASSWORD}@postgres:5432/${POSTGRES_DB:-crm_db}}
|
||||
MIGRATION_DATABASE_URL: ${MIGRATION_DATABASE_URL:-postgresql+asyncpg://crm_user:${DB_PASSWORD}@postgres:5432/${POSTGRES_DB:-crm_db}}
|
||||
|
||||
+3
-18
@@ -1160,6 +1160,7 @@ def deploy_initial() -> int:
|
||||
{"key": "STORAGE_PATH", "value": os.environ.get("STORAGE_PATH", "/data/storage")},
|
||||
{"key": "CORS_ORIGINS", "value": APP_DOMAIN},
|
||||
{"key": "FRONTEND_URL", "value": APP_DOMAIN},
|
||||
{"key": "APP_DOMAIN", "value": APP_DOMAIN},
|
||||
{"key": "ADMIN_EMAIL", "value": os.environ.get("ADMIN_EMAIL", "admin@media-on.de")},
|
||||
{"key": "ADMIN_PASSWORD", "value": os.environ.get("ADMIN_PASSWORD", "Admin123!")},
|
||||
]
|
||||
@@ -1179,24 +1180,8 @@ def deploy_initial() -> int:
|
||||
steps.append(("Set envs", StepResult(False, str(e))))
|
||||
_print_result(steps[-1][1])
|
||||
|
||||
# Step 4: Set domain via docker_compose_domains + Deploy
|
||||
print("\n[4/4] Setting domain and deploying...")
|
||||
if APP_DOMAIN:
|
||||
try:
|
||||
resp = httpx.patch(
|
||||
f"{client.base_url}/api/v1/applications/{app_uuid}",
|
||||
headers=client.headers,
|
||||
json={
|
||||
"docker_compose_domains": [
|
||||
{"name": "crm-app", "domain": f"{APP_DOMAIN}:443"}
|
||||
]
|
||||
},
|
||||
timeout=30,
|
||||
)
|
||||
print(f" Domain set: {APP_DOMAIN} ({resp.status_code})")
|
||||
except Exception as e:
|
||||
print(f" Warning: could not set domain: {e}")
|
||||
|
||||
# Step 4: Deploy via /api/v1/deploy (Magic ENV SERVICE_FQDN_CRM_APP_8000 handles domain)
|
||||
print("\n[4/4] Deploying docker-compose stack...")
|
||||
try:
|
||||
resp = httpx.post(
|
||||
f"{client.base_url}/api/v1/deploy",
|
||||
|
||||
Reference in New Issue
Block a user