fix(docker): implement retry logic for package installation and optimize image usage in docker-compose

This commit is contained in:
hamed
2026-06-28 09:57:11 +03:30
parent 90a908c503
commit 26fe7c4fc0
2 changed files with 16 additions and 11 deletions
+8 -8
View File
@@ -49,6 +49,10 @@ services:
# CORS/payload allow-listing for those frontends is handled separately via
# CORS_ALLOW_ORIGIN / ALLOWED_FRONTEND_HOSTS (see docker/frontend-domains.json).
app:
# Shared image tag — app builds it once; the two workers reuse the SAME image
# (image: below, no build:). Without this Coolify builds the Dockerfile 3×,
# tripling apk/pecl network fetches and intermittently failing on the host.
image: clinicpro-app:latest
build:
context: .
dockerfile: Dockerfile
@@ -65,11 +69,9 @@ services:
retries: 5
start_period: 60s
# SMS / async message consumer.
# SMS / async message consumer. Reuses the image built by `app` (no build:).
worker-async:
build:
context: .
dockerfile: Dockerfile
image: clinicpro-app:latest
restart: unless-stopped
command: php bin/console messenger:consume async --time-limit=3600 --memory-limit=128M -v
environment:
@@ -78,11 +80,9 @@ services:
volumes: *app-volumes
depends_on: *app-depends
# Scheduler consumer — expires unpaid appointments every minute.
# Scheduler consumer — expires unpaid appointments every minute. Reuses app's image.
worker-scheduler:
build:
context: .
dockerfile: Dockerfile
image: clinicpro-app:latest
restart: unless-stopped
command: php bin/console messenger:consume scheduler_default --time-limit=3600 -v
environment: