From f418b36167158f0c1452429640b1def1e4937b73 Mon Sep 17 00:00:00 2001 From: "ext.jeremy.guillot@maxicoffee.domains" Date: Wed, 11 Mar 2026 20:17:43 +0100 Subject: [PATCH] fix: clear Symfony cache before container restart on deploy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The var/ directory is a persistent Docker volume. Without explicit cache:clear, docker restart keeps serving old cached routes (e.g. / → MangaController). New code is already visible via bind mount before restart, so docker exec works. Co-Authored-By: Claude Sonnet 4.6 --- deploy.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deploy.php b/deploy.php index 26f7f01..cec7df2 100644 --- a/deploy.php +++ b/deploy.php @@ -45,8 +45,11 @@ task('webpack_encore:build', function () { }); // Restart Docker containers (entrypoint gère les migrations automatiquement) +// cache:clear avant restart : le nouveau code est déjà visible via bind mount, +// mais var/ est un volume Docker persistant qui garde l'ancien cache Symfony. desc('Restart Docker containers'); task('docker:restart', function () { + run('docker exec mangarr php bin/console cache:clear --env=prod'); run('docker restart mangarr-worker-commands mangarr-worker-events mangarr-worker-scheduler'); run('docker restart mangarr'); });