refactor: separate MariaDB and Redis into independent Coolify resources

This commit is contained in:
hamed
2026-06-28 11:28:29 +03:30
parent 471f43248b
commit 42bb723333
6 changed files with 323 additions and 72 deletions
+14
View File
@@ -8,6 +8,20 @@ chown -R www-data:www-data var public/uploads config/jwt 2>/dev/null || true
# One-time init tasks — only the web service runs these (RUN_INIT=1).
# Workers set RUN_INIT=0 so DB migrations / JWT generation don't race.
if [ "${RUN_INIT:-1}" = "1" ]; then
# MariaDB is a SEPARATE Coolify resource now, so there is no compose
# depends_on: service_healthy gate. Wait for it to accept connections
# (up to ~60s) before migrating, otherwise the first boot races the DB.
i=0
until php bin/console doctrine:query:sql "SELECT 1" >/dev/null 2>&1; do
i=$((i + 1))
if [ "$i" -ge 30 ]; then
echo "Database not reachable after 60s — aborting." >&2
exit 1
fi
echo "waiting for database... ($i)"
sleep 2
done
# Generate JWT keypair if not already persisted on the jwt_keys volume.
php bin/console lexik:jwt:generate-keypair --skip-if-exists --no-interaction
+2 -2
View File
@@ -1,7 +1,7 @@
; Production PHP settings for ClinicPro on Coolify
memory_limit = 256M
memory_limit = 1024M
upload_max_filesize = 16M
post_max_size = 16M
post_max_size = 32M
max_execution_time = 60
expose_php = Off
date.timezone = Asia/Tehran