Commit Graph
10 Commits
Author SHA1 Message Date
hamedandClaude Opus 4.8 5f557b2c57 perf(docker): parallel ext compile (MAKEFLAGS=-j) to beat Coolify build timeout
Coolify builds with --no-cache, so intl (C++) recompiles from source every
deploy (~180s single-threaded) and overran the build timeout (exit 255).
Compile across all cores via MAKEFLAGS=-j$(nproc) to cut it several-fold.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 15:38:10 +03:30
hamedandClaude Opus 4.8 5150365d2c harden(docker): non-root, dedicated healthcheck, opcache split, graceful shutdown
Coolify-doc-driven production hardening of the deploy stack:
- run the whole stack as non-root www-data; nginx on 8080 (non-privileged),
  pid in /tmp, user directive dropped (Coolify routes to any port)
- docker/healthcheck.sh: hit real /health route via PHP (not just port probe)
- split OPcache config into docker/php/opcache.ini
- graceful shutdown: supervisord stopsignal/stopwaitsecs + worker stop_grace_period
- APCu intentionally not added (Symfony cache uses redis)
- DEPLOY.md: 8080 port, non-root, resource-limit guidance

Verified on linux/amd64: non-root uid=82, /health 200, migrations run,
worker process healthcheck OK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 15:27:34 +03:30
hamedandClaude Opus 4.8 61ffb2ecd8 fix(docker): retry composer install + source fallback for flaky GitHub on Coolify
Coolify build host intermittently gets HTTP 400 from codeload.github.com on
Composer dist downloads. Bump COMPOSER_HTTP_RETRIES, wrap the install in a
5x retry loop, and on final attempt fall back to --prefer-source (git clone,
different endpoint than dist zips).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 14:25:48 +03:30
hamedandClaude Opus 4.8 471f43248b fix(docker): generate minimal .env when absent (repo .env is gitignored)
Symfony Dotenv::bootEnv() hard-requires a .env file even in prod. The repo's
.env holds dev secrets and is gitignored, so Coolify's clone ships none and the
app fatals with 'Unable to read /app/.env'. Write a minimal APP_ENV=prod .env
at build if one wasn't copied; all real values still come from the compose
environment (clear_env=no), which Dotenv never overwrites.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 10:54:38 +03:30
hamedandClaude Opus 4.8 46e462c6b9 fix(docker): build phpredis from GitHub source (Coolify host can't reach pecl.php.net)
pecl install redis and install-php-extensions both fail on the Coolify build
host with 'No releases available for package pecl.php.net/redis' — that host
cannot reach the pecl registry. Build phpredis 6.1.0 from its GitHub source
tarball instead (github.com is reachable); pdo_mysql/intl/opcache stay as
bundled docker-php-ext-install (no network).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 10:34:18 +03:30
hamed 8ae35b1c8f fix(docker): enhance PHP extension installation with retry logic and use prebuilt binaries 2026-06-28 10:09:32 +03:30
hamed 26fe7c4fc0 fix(docker): implement retry logic for package installation and optimize image usage in docker-compose 2026-06-28 09:57:11 +03:30
hamed 90a908c503 fix(migrations): ensure safe migration steps for doctor_expertise and doctor_cities, drop legacy tables conditionally 2026-06-28 09:32:27 +03:30
hamed e966e11807 feat: update Docker configuration and add deployment documentation for Coolify 2026-06-27 21:27:58 +03:30
hamed cffc88db05 feat: Implement Docker-based deployment for ClinicPro on Coolify
- Added Dockerfile for multi-stage build including PHP, Node.js, and Nginx.
- Created docker-compose.coolify.yaml for service orchestration with app, workers, MariaDB, and Redis.
- Introduced entrypoint.sh for initialization tasks like JWT key generation and database migrations.
- Configured Nginx with default.conf for handling requests and routing to PHP-FPM.
- Added php.ini with production settings and opcache configuration.
- Set up supervisord.conf to manage PHP-FPM and Nginx processes.
- Created frontend-domains.json for managing allowed frontend domains.
- Added gen-cors-env.php script to generate CORS environment variables from frontend domains.
- Updated framework.yaml to configure trusted proxies and headers.
- Created .dockerignore to exclude unnecessary files from the Docker context.
- Added .env.coolify.example for environment variable configuration.
- Documented deployment steps and troubleshooting in coolify.md.
2026-06-25 21:27:28 +03:30