This log summarizes the work completed to achieve a reliable, GitOps-friendly Mautic 6 deployment on Coolify. It captures changes, decisions, and the current state for reproducibility.
- Base image:
mautic/mautic:6-apache - Project layout: Mautic 6 recommended-project (web root in
docroot/) - Orchestration: Docker Compose (Coolify builds/deploys)
- Database: Percona 8.0
- Harden Docker entrypoint for recommended-project paths; defer DB ops until real install exists.
- Fix Dockerfile build/runtime issues; correct CMD; set Apache DocumentRoot to
docroot; enable rewrite. - Correct compose volumes (config/media/logs/cache) and enforce required envs with
${VAR:?required}. - Resolve installer write/permissions; ensure config path at project root and symlink under docroot.
- Address reverse-proxy behavior via
site_url, trusted proxies/hosts, and cache clear. - App now installs and reaches the dashboard; SES setup pending; cron via Coolify Scheduled Jobs.
-
Dockerfile- Multi-stage with Composer (
--no-dev --no-scripts --ignore-platform-reqs). - Copy only
vendor/to runtime image. - Set
APACHE_DOCUMENT_ROOT=/var/www/html/docroot; update Apache configs. - Enable
mod_rewrite; set defaultServerName localhost. - Add
docroot/config -> ../configsymlink. - Fix
CMDtoapache2-foreground(removed invalid/docker-entrypoint.sh).
- Multi-stage with Composer (
-
docker/entrypoint.sh- Define
APP_DIR=/var/www/html,WEB_DIR=$APP_DIR/docroot. - Detect install via
APP_DIR/config/local.php; treat known stub as NOT installed. - Create and chown
APP_DIR/config; ensurevar/dirs exist and are writable. - Gate DB wait/migrations/cache/assets until installed; then run
bin/consoletasks. - Hand off to base
docker-php-entrypointfor robust Apache/PHP init.
- Define
-
docker-compose.yaml- DB: Percona 8.0,
mysqladmin pinghealthcheck with sensible timing. - App: build from
.; depends_on DB health. - Volumes:
mautic_config -> /var/www/html/config(project root)mautic_media -> /var/www/html/docroot/mediamautic_logs -> /var/www/html/docroot/var/logsmautic_cache -> /var/www/html/docroot/var/cache
- Env guards:
${VAR:?required}for DB,APP_SECRET,MAUTIC_SITE_URL. - Trust proxies env retained (post-install values live in
config/local.php).
- DB: Percona 8.0,
-
docs/coolify.md- Manual Coolify setup steps (envs, volumes, build/deploy).
- Cron via Coolify Scheduled Jobs with
php bin/consolecommands. - Notes on SES SMTP configuration and troubleshooting.
- Defer all DB operations until a real (non-stub)
local.phpexists to prevent migrations on an empty schema. - Keep build lean: Composer without scripts; generate assets at runtime.
- Align Apache DocumentRoot to
docrootper recommended-project; enable rewrite. - Persist config at project root (
/var/www/html/config) with a symlink atdocroot/configfor compatibility. - Use Coolify Scheduled Jobs for cron (no in-container cron), keeping runtime behavior explicit and reproducible.
- Prefer AWS SES for SMTP; plan to integrate bounces/complaints via SNS (avoids PHP IMAP).
- Remove IaC for Coolify due to provider limitations; favor clear manual steps + GitOps.
- Installer completed; dashboard accessible.
- DB connectivity validated via
doctrine:query:sqlin-container. - Entrypoint gates DB wait/migrations/cache/assets appropriately;
INITIAL_SKIP_DB_WAITshould now befalsefor restarts. - Apache running with
docrootand rewrite enabled; defaultServerNameset. - Cron to be configured in Coolify: segments, campaigns rebuild/trigger, broadcasts, webhooks, emails (if queued).
- SES SMTP can be configured in Mautic UI (TLS 587 using SES SMTP creds).
- Preference: implement SES SNS bridge for bounces/complaints (no IMAP dependency).
- Configure Coolify Scheduled Jobs (copy commands from docs) and validate.
- Set up SES SMTP in Mautic and send a test email.
- Implement optional SNS bridge service and document SES topic/subscription (if chosen).
- Clean repo: remove Terraform/Coolify automation artifacts; ensure docs reflect manual Coolify + GitOps flow.
- Verify
config/local.phpcontains:site_url=https://m.dreliane.comtrusted_proxies=["0.0.0.0/0"]trusted_hosts=["m.dreliane.com"]- Then
php bin/console cache:clear.
- Aim: minimal manual steps; push-to-deploy via Coolify with enforced env guards and clear runtime behaviors.
- Deliverables pending: SNS bridge (optional), repo cleanup, and final documentation tweaks.