From 48e6b15bb206b4ab5dffc7157f990ce8decd49b7 Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Wed, 5 Aug 2026 22:46:33 +0200 Subject: [PATCH] fix: service names with underscores (crm_app, crm_worker) + docker_compose_domains with crm_app --- docker-compose.yaml | 20 +++++++------------- scripts/deploy.py | 20 ++++++++++++++++++-- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index f740472..e047d3f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,11 +1,3 @@ -# ============================================================================= -# docker-compose.yml — LeoCRM Multi-Container Setup -# -# Full stack: PostgreSQL + Redis + App + Worker, all with persistent volumes. -# Coolify manages networking, labels, and domains — no custom networks or labels. -# No hardcoded secrets, UUIDs, or domains — everything from environment. -# ============================================================================= - services: postgres: image: pgvector/pgvector:pg16 @@ -36,7 +28,7 @@ services: timeout: 5s retries: 5 - crm-app: + crm_app: build: context: . dockerfile: Dockerfile @@ -66,6 +58,8 @@ services: SMTP_FROM: ${SMTP_FROM:-no-reply@localhost} SMTP_TLS: ${SMTP_TLS:-true} BCRYPT_ROUNDS: ${BCRYPT_ROUNDS:-12} + ADMIN_EMAIL: ${ADMIN_EMAIL:-admin@media-on.de} + ADMIN_PASSWORD: ${ADMIN_PASSWORD:-Admin123!} volumes: - storage:/data/storage healthcheck: @@ -73,9 +67,9 @@ services: interval: 30s timeout: 10s retries: 3 - start_period: 30s + start_period: 60s - crm-worker: + crm_worker: build: context: . dockerfile: Dockerfile @@ -85,7 +79,7 @@ services: condition: service_healthy redis: condition: service_healthy - crm-app: + crm_app: condition: service_healthy entrypoint: ["/app/worker.sh"] environment: @@ -112,7 +106,7 @@ services: interval: 30s timeout: 10s retries: 3 - start_period: 30s + start_period: 60s volumes: pgdata: {} diff --git a/scripts/deploy.py b/scripts/deploy.py index a469598..c3f4d21 100644 --- a/scripts/deploy.py +++ b/scripts/deploy.py @@ -1180,8 +1180,24 @@ def deploy_initial() -> int: steps.append(("Set envs", StepResult(False, str(e)))) _print_result(steps[-1][1]) - # Step 4: Deploy via /api/v1/deploy (Magic ENV SERVICE_FQDN_CRM_APP_8000 handles domain) - print("\n[4/4] Deploying docker-compose stack...") + # 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}:443 ({resp.status_code})") + except Exception as e: + print(f" Warning: could not set domain: {e}") + try: resp = httpx.post( f"{client.base_url}/api/v1/deploy",