From 926f938c45e1f29175fdaf6d91676c10fa39c4ca Mon Sep 17 00:00:00 2001 From: "ext.jeremy.guillot@maxicoffee.domains" Date: Thu, 26 Mar 2026 18:49:30 +0100 Subject: [PATCH] =?UTF-8?q?fix(deploy):=20vider=20le=20cache=20prod=20au?= =?UTF-8?q?=20d=C3=A9marrage=20du=20conteneur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sans ce fix, les workers FrankenPHP démarrent avec l'ancien cache persisté dans le volume Docker. Si les classes référencées (ex. EntityManagerGhost, LazyGhostTrait) ne correspondent plus à la version déployée, les workers crashent en boucle, rendant le conteneur instable et faisant échouer le cache:clear lancé ensuite par Deployer (exit 137). La suppression de var/cache/prod à l'entrypoint garantit que les workers démarrent toujours sur un cache vierge, généré à chaud à la première requête. --- frankenphp/docker-entrypoint.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frankenphp/docker-entrypoint.sh b/frankenphp/docker-entrypoint.sh index 9823560..907822c 100755 --- a/frankenphp/docker-entrypoint.sh +++ b/frankenphp/docker-entrypoint.sh @@ -53,6 +53,13 @@ if [ "$1" = 'frankenphp' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then fi fi + # Vider le cache prod stale avant le démarrage des workers FrankenPHP. + # Sans ça, les workers chargent l'ancien cache du volume Docker et crashent + # en boucle si les classes du cache ne correspondent plus à la version déployée. + if [ "$APP_ENV" = "prod" ]; then + rm -rf var/cache/prod + fi + setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var setfacl -dR -m u:www-data:rwX -m u:"$(whoami)":rwX var fi -- 2.49.1