<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet href="https://jolicode.com/feed.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xml:lang="fr-FR">
    <id>https://jolicode.com/blog</id>
    <link type="text/html" rel="alternate" href="https://jolicode.com/blog"/>
    <link type="application/rss+xml" rel="self" href="https://jolicode.com/feed" />

            <title>JoliCode blog - les derniers articles</title>
        <updated>2026-05-27T14:54:08+02:00</updated>    <entry>
        <id>https://jolicode.com/blog/afup-day-2026-paris-retour-sur-une-journee-dans-l-ecosysteme-php</id>
        <published>2026-05-26T15:30:00+02:00</published>
        <updated>2026-05-26T15:30:00+02:00</updated>
        <link type="text/html" rel="alternate" href="https://jolicode.com/blog/afup-day-2026-paris-retour-sur-une-journee-dans-l-ecosysteme-php"/>
        <title>AFUP Day 2026 Paris, retour sur une journée dans l&#039;écosystème PHP</title>
        <author>
            <name>JoliCode Team</name>
            <uri>https://jolicode.com/</uri>
        </author>            <category term="php" />            <category term="symfony" />            <category term="afup" />            <category term="ia" />        <summary><![CDATA[Ce vendredi 22 mai 2026, l&#039;équipe JoliCode était présente à l&#039;AFUP Day 2026 Paris à l&#039;ESGI Paris pour une journée de conférences. L&#039;ambiance était conviviale et studieuse, avec un programme axé sur l&#039;IA,…]]></summary>
        <content type="html">
            &lt;p&gt;Ce vendredi 22 mai 2026, l&#039;équipe JoliCode était présente à l&#039;AFUP Day 2026 Paris à l&#039;ESGI Paris pour une journée de conférences. L&#039;ambiance était conviviale et studieuse, avec un programme axé sur l&#039;IA, l&#039;architecture et la productivité.&lt;/p&gt;
&lt;p&gt;Nous avons eu l&#039;honneur de présenter deux sujets, Loïck Piera sur Castor 🦫 et Grégoire Pineau sur Symfony IA.&lt;/p&gt;
&lt;h2&gt;Les temps forts techniques&lt;/h2&gt;
&lt;p&gt;Le programme a couvert des thématiques essentielles qui font évoluer nos pratiques au quotidien, et a aussi rappelé quelques bases que nous connaissons bien.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;js-dialog-target&quot; data-original-url=&quot;/media/original/2026/afup-day/salle-conference.jpg&quot; data-original-width=&quot;3589&quot; data-original-height=&quot;2262&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;/media/cache/content-webp/2026/afup-day/salle-conference.4ddd7dc1.webp&quot; /&gt;&lt;source type=&quot;image/jpeg&quot; srcset=&quot;/media/cache/content/2026/afup-day/salle-conference.jpg&quot; /&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; style=&quot;width: 996px; ; aspect-ratio: calc(3589 / 2262)&quot; src=&quot;https://jolicode.com//media/cache/content/2026/afup-day/salle-conference.jpg&quot; alt=&quot;La salle de la conférence&quot; /&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;h3&gt;Intelligence Artificielle et Innovation dans Symfony&lt;/h3&gt;
&lt;p&gt;L&#039;IA a été au cœur de plusieurs échanges, montrant son intégration progressive dans nos outils quotidiens :&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Symfony AI et Embeddings&lt;/strong&gt; : Grégoire Pineau a présenté son retour sur l&#039;utilisation des embeddings dans Symfony pour des recherches et rapprochements sémantiques poussés - &lt;a href=&quot;https://jolicode.com/blog/notre-retour-sur-le-symfonylive-paris-2026#embeddings-en-php-symfony-ai-en-pratique-gregoire-pineau&quot;&gt;nous vous invitons à retrouver notre récapitulatif de Symfony Live où nous en parlions déjà&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Assistance Générative&lt;/strong&gt; : Florence Cauchy a partagé un guide pratique sur l&#039;intégration de GitHub Copilot et Claude dans nos workflows. Nous partageons ses conseils :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Mise en place de skills ;&lt;/li&gt;
&lt;li&gt;Définition de guidelines pour les agents ;&lt;/li&gt;
&lt;li&gt;Exploiter aussi bien le CLI que les agents cloud.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Si vous n&#039;avez pas encore d&#039;assistance par LLM pour coder, c&#039;était une bonne introduction !&lt;/p&gt;
&lt;h3&gt;Outillage, Productivité et Modernisation&lt;/h3&gt;
&lt;p&gt;Nous avons exploré de nouveaux outils pour optimiser notre productivité :&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Castor&lt;/strong&gt; : Loïck Piera nous a fait découvrir les coulisses de ce &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://castor.jolicode.com/&quot;&gt;task runner open source&lt;/a&gt; indispensable 😉 (oui c&#039;est nous qui le développons). L&#039;occasion de parler des outils sur lesquels repose Castor comme &lt;code&gt;symfony/console&lt;/code&gt;, et de parler de fonctionnalités peu connues comme :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Les events pour étendre le fonctionnement ;&lt;/li&gt;
&lt;li&gt;Les imports distants pour utiliser des tasks extérieures ;&lt;/li&gt;
&lt;li&gt;Les remote exécutions, pour lancer des outils sans les installer.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Nous vous invitons &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://speakerdeck.com/pyrech/sous-le-capot-de-castor-le-task-runner-php&quot;&gt;à lire les slides qui sont pleines d&#039;informations&lt;/a&gt; !&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Sidekicks applicatifs&lt;/strong&gt; : Nicolas Grekas a présenté comment tirer partie de Caddy/FrankenPHP pour faciliter la configuration de nos applications HTTP. Grâce à ces sidekicks, l&#039;application peut continuer à tourner en mode worker (donc sans avoir à redémarrer de 0 à chaque requête, comme c&#039;est le cas avec PHP-FPM) mais en ayant sa configuration à jour :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;côté application, on récupère une valeur de configuration, qui est locale et toujours à jour, grâce à un simple appel à une fonction ;&lt;/li&gt;
&lt;li&gt;un thread tourne à côté pour mettre à jour cette valeur dès qu&#039;il y a un changement (ce thread est setup très simplement dans Caddy / FrankenPHP).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Il aimerait voir cette nouvelle manière de faire devenir un standard dans l&#039;écosystème PHP, à la place du traditionnel php-fpm, afin d&#039;être égaux avec les technos alternatives à PHP comme node, qui proposent des comportement similaires.&lt;/p&gt;
&lt;h3&gt;Architecture et Qualité du Code&lt;/h3&gt;
&lt;p&gt;La durabilité logicielle et les bonnes pratiques restent fondamentales :&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Qualité avec PHPStan&lt;/strong&gt; : Vincent Langlet &amp;amp; Étienne Dhennin nous font la présentation de leur mise en place d&#039;un écosystème de qualité chez Weglot.
Ils nous ont présenté les différents fixers, linters et outils de tests disponibles et qu&#039;ils ont utilisés, pour répondre à leur définition de la qualité : &lt;strong&gt;la capacité d&#039;un système à remplir son rôle aujourd&#039;hui comme demain&lt;/strong&gt;, au travers de trois dimensions : fonctionnelle, temporelle et humaine.
La direction de l&#039;entreprise avait besoin de justifications pour le temps passé à faire de la qualité, et ils ont donc introduit un métrique original : le taux de hotfix en production (et donc oui il a baissé).&lt;/p&gt;
&lt;p&gt;Parmi leurs retours d’expérience sur PHPStan en particulier :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ne pas générer de baseline sur les projets legacy, prioriser les niveaux &amp;quot;bas&amp;quot; (jusqu’au niveau 5) - nous sommes partagés sur ce point car la baseline permet justement de pouvoir contribuer à des projets legacy avec une analyse statique élevé sur nos nouveaux développements ;&lt;/li&gt;
&lt;li&gt;Privilégier les extensions spécifiques à votre projet (&lt;code&gt;phpstan-doctrine&lt;/code&gt; par exemple) aux niveaux 9 et 10, souvent superflus.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;API Design Pragmatique&lt;/strong&gt; : Amaury Bouchard a exploré des alternatives au design d&#039;APIs. Il critique pas mal JWT car ça ne gère pas l&#039;expiration par exemple. Un des points que nous partageons est que HTTP Basic aujourd&#039;hui c&#039;est tout à fait valide et sécurisé (car en HTTPS il n&#039;y a pas de &amp;quot;fuite&amp;quot; des identifiants).
Le take-away du talk concerne le choix entre &lt;abbr title=&quot;Remote Procedure Call&quot;&gt;RPC&lt;/abbr&gt; et REST. Vouloir utiliser absolument du REST alors que notre API ne gère pas des états mais des actions est un mauvais choix de design. En résumé :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;RPC pour les API qui font des actions (envoyer un mail, publier des redirections...) ;&lt;/li&gt;
&lt;li&gt;REST pour les API qui modifient des états, le CRUD, etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;En bref, un appel à la simplicité, quitte à remettre en questions des dogmes acquis depuis très longtemps, de très bons sujets de réflexion lors de votre prochaine conception d’API.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tests sans Mocks&lt;/strong&gt; : Imen Ezzine a présenté une solution intéressante pour tester efficacement des APIs externes sans recourir aux mocks - et surtout pour pallier à l&#039;imcompatibilité de &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://php-vcr.github.io/&quot;&gt;PHP-VCR&lt;/a&gt; avec le client HTTP de Symfony.&lt;/p&gt;
&lt;p&gt;En utilisant le format HAR,  un nouveau decorator RecorderHttpClient, et un simple attribut &lt;code&gt;#[UseRecord]&lt;/code&gt; sur les fonctions de test (via le bridge phpunit), nous pouvons enregistrer une réponse API, de sorte à pouvoir utiliser plus tard cet enregistrement pour simuler des appels à une API externe. Ainsi, pas besoin de créer un mock ! L’appel est joué réellement une seule fois, puis réutilisé directement au moment de lancer les tests. Un mécanisme permet de configurer son mode d’enregistrement, pour rafraîchir périodiquement, rejouer l’appel à chaque fois ou au contraire le verrouiller.&lt;/p&gt;
&lt;p&gt;L’ensemble apparaît comme une solution efficace et très élégante pour s’affranchir d’une problématique que nous avons tous déjà rencontrée. Une PR est soumise sur Symfony 8.2.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Gestion des Exceptions&lt;/strong&gt; : Smaïne Milianni a récapitulé les meilleures pratiques pour gérer et logguer les exceptions proprement. De bons rappels et peut être même des guidelines à coller dans nos &lt;code&gt;AGENTS.md&lt;/code&gt; !&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Relancer systématiquement les exceptions attrapées dans les couches “profondes” de l’application (métier, infra…), pour les gérer uniquement dans les couches d’interface.&lt;/li&gt;
&lt;li&gt;Ne pas catcher la terre entière (&lt;code&gt;catch \Exception&lt;/code&gt;) ;&lt;/li&gt;
&lt;li&gt;Ne pas catcher &lt;code&gt;Throwable&lt;/code&gt; si on est bas niveau ;&lt;/li&gt;
&lt;li&gt;Ne jamais &amp;quot;rien faire&amp;quot; dans le &amp;quot;catch&amp;quot; (il faut au moins un log) ;&lt;/li&gt;
&lt;li&gt;Utiliser une exception pour faire du contrôle de flow classique (nous sommes un peu partagé à ce sujet aussi - c&#039;est parfois élégant) ;&lt;/li&gt;
&lt;li&gt;Catcher et relancer une exception sans n&#039;avoir rien changé / rien fait : autant de rien catcher ;&lt;/li&gt;
&lt;li&gt;ne jamais oublier l&#039;argument &lt;code&gt;$previous&lt;/code&gt; quand on rethrow / mute une exception ;&lt;/li&gt;
&lt;li&gt;créer des exceptions custom, utiliser des constructeurs statiques... pour nos exceptions métier.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;picture class=&quot;js-dialog-target&quot; data-original-url=&quot;/media/original/2026/afup-day/http-mock.jpg&quot; data-original-width=&quot;4080&quot; data-original-height=&quot;3072&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;/media/cache/content-webp/2026/afup-day/http-mock.42f43150.webp&quot; /&gt;&lt;source type=&quot;image/jpeg&quot; srcset=&quot;/media/cache/content/2026/afup-day/http-mock.jpg&quot; /&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; style=&quot;width: 996px; ; aspect-ratio: calc(4080 / 3072)&quot; src=&quot;https://jolicode.com//media/cache/content/2026/afup-day/http-mock.jpg&quot; alt=&quot;Imen Ezzine sur scène&quot; /&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;h3&gt;Sujets intemporels&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Passkeys et WebAuthn&lt;/strong&gt; : Sylvain Combraque nous a fait un rapide cours historique sur les manières de stocker les mots de passe utilisateurs, du très sécurisé plaintext jusqu&#039;au hashage, sans oublier l&#039;&lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://openid.net/developers/how-connect-works/&quot;&gt;OICD&lt;/a&gt; pour nous montrer comment avec le temps, nous avons pu répondre aux questions de sécurité liées à nos systèmes d&#039;authentification.
Il nous a finalement expliqué qu&#039;au final, la manière la plus simple de sécuriser nos mots de passe, c&#039;est de ne pas en avoir ! Chose possible aujourd&#039;hui et depuis 2015 grâce aux Passkeys, une solution d&#039;authentification locale, unique par compte, et impossible à faire fuiter. Cela fait 10 ans que nous en entendons parler et que les briques techniques existent, et pourtant, ce n&#039;est toujours pas &amp;quot;grand public&amp;quot; ! Les mots de passe ont encore de beaux jours devant eux... À nous de faire bouger les lignes !&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Gotchas PHP&lt;/strong&gt; : Frédéric Bouchery a animé une session interactive sur les comportements inattendus et les subtilités du langage. Par exemple, saviez-vous que &lt;code&gt;new daTeTimE();&lt;/code&gt; fonctionne aussi bien que &lt;code&gt;new DateTime();&lt;/code&gt; mais que vos constantes elles, sont sensibles à la casse ?
C&#039;était une façon très ludique de nous expliquer des principes du langage comme la compilation, les changements de syntaxes...&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Au-delà de la technique, l&#039;AFUP Day a été un moment de partage plein d&#039;échanges et riche en apprentissages. Nous sommes vraiment ravis de retrouver un événement à Paris.&lt;/p&gt;
&lt;p&gt;Les perspectives ouvertes par l&#039;IA et la modernisation des outils promettent des projets passionnants pour JoliCode. Un grand merci à l&#039;AFUP Paris et à tous les bénévoles pour cette organisation impeccable 👏 Comptez sur nous l&#039;année prochaine !&lt;/p&gt;

        </content>
    </entry>    <entry>
        <id>https://jolicode.com/blog/comment-integrer-l-ia-dans-son-workflow-ux-ui</id>
        <published>2026-05-12T12:42:00+02:00</published>
        <updated>2026-05-12T12:42:00+02:00</updated>
        <link type="text/html" rel="alternate" href="https://jolicode.com/blog/comment-integrer-l-ia-dans-son-workflow-ux-ui"/>
        <title>Comment intégrer l&#039;IA dans son workflow UX/UI</title>
        <author>
            <name>JoliCode Team</name>
            <uri>https://jolicode.com/</uri>
        </author>            <category term="ux" />            <category term="ia" />            <category term="ui" />        <summary><![CDATA[&amp;quot;On a déjà deux agents IA qui tournent en interne.&amp;quot;
Ce n&#039;est pas en réunion que j&#039;ai entendu ça. C&#039;est en mission chez un client, dans leurs bureaux. Ce genre de phrase, je l&#039;entends de plus…]]></summary>
        <content type="html">
            &lt;p&gt;&lt;em&gt;&lt;strong&gt;&amp;quot;On a déjà deux agents IA qui tournent en interne.&amp;quot;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Ce n&#039;est pas en réunion que j&#039;ai entendu ça. C&#039;est en mission chez un client, dans leurs bureaux. Ce genre de phrase, je l&#039;entends de plus en plus souvent maintenant, entre deux écrans, dans les couloirs, pendant la pause déjeuner. L&#039;IA fait désormais partie du quotidien.&lt;/p&gt;
&lt;p&gt;Quelques semaines plus tard, un autre client nous présente deux pages de maquettes générées par Claude, structure de page et premières intentions de contenu, pour expliquer ce qu&#039;il voulait avant même d’ouvrir Figma.&lt;/p&gt;
&lt;p&gt;C&#039;est ce constat qui nous a poussés à écrire cet article, pour poser ce que ça change dans notre façon de travailler, et ce qu&#039;on peut en tirer concrètement pour nos projets et nos clients.&lt;/p&gt;
&lt;p&gt;Ce que j&#039;ai trouvé en explorant, c&#039;est que l&#039;IA ne remplace pas le designer, elle redistribue son temps et son attention. Certaines tâches s&#039;accélèrent, d&#039;autres disparaissent, et de nouvelles compétences deviennent importantes. La principale d&#039;entre elles, j&#039;y reviendrai, est la capacité à formuler des demandes précises. Savoir parler à une IA, ça s&#039;apprend et ça change tout à la qualité des résultats.&lt;/p&gt;
&lt;h2&gt;Le prompt : la compétence clé&lt;/h2&gt;
&lt;p&gt;Avant de parler workflow et processus, un point essentiel, la qualité des résultats dépend de la qualité de la demande. C&#039;est le cœur du sujet.&lt;/p&gt;
&lt;p&gt;Un bon prompt, c&#039;est un bon brief. Précis, contextualisé, avec une intention claire et des contraintes définies. L&#039;erreur la plus fréquente, celle que j&#039;ai faite moi-même au début, c&#039;est de rester trop vague en espérant que l&#039;IA devine l&#039;intention derrière la demande.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ex : Prompt trop vague&lt;/strong&gt;&lt;br /&gt;
&lt;em&gt;&amp;quot;Génère un UX flow pour un site e-commerce.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;js-dialog-target&quot; data-original-url=&quot;/media/original/2026/workflow-ia-ux-ui/article-ai-design-01.jpg&quot; data-original-width=&quot;1920&quot; data-original-height=&quot;1080&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;/media/cache/content-webp/2026/workflow-ia-ux-ui/article-ai-design-01.58842894.webp&quot; /&gt;&lt;source type=&quot;image/jpeg&quot; srcset=&quot;/media/cache/content/2026/workflow-ia-ux-ui/article-ai-design-01.jpg&quot; /&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; style=&quot;width: 996px; ; aspect-ratio: calc(1920 / 1080)&quot; src=&quot;https://jolicode.com//media/cache/content/2026/workflow-ia-ux-ui/article-ai-design-01.jpg&quot; alt=&quot;Génère un UX flow pour un site e-commerce&quot; /&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ex : Prompt structuré&lt;/strong&gt;&lt;br /&gt;
&lt;em&gt;&amp;quot;Génère un UX flow pour la page produit d&#039;un site e-commerce de mode féminine, destiné à des femmes de 25–40 ans sur mobile. Inclure : découverte produit, sélection de taille, ajout au panier, paiement, et edge cases (taille indisponible, rupture de stock, code promo invalide). Format en étapes claires avec états d&#039;erreur et micro-interactions.&amp;quot;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;js-dialog-target&quot; data-original-url=&quot;/media/original/2026/workflow-ia-ux-ui/article-ai-design-02.jpg&quot; data-original-width=&quot;1920&quot; data-original-height=&quot;1080&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;/media/cache/content-webp/2026/workflow-ia-ux-ui/article-ai-design-02.cf2c3f4f.webp&quot; /&gt;&lt;source type=&quot;image/jpeg&quot; srcset=&quot;/media/cache/content/2026/workflow-ia-ux-ui/article-ai-design-02.jpg&quot; /&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; style=&quot;width: 996px; ; aspect-ratio: calc(1920 / 1080)&quot; src=&quot;https://jolicode.com//media/cache/content/2026/workflow-ia-ux-ui/article-ai-design-02.jpg&quot; alt=&quot;Génère un UX flow pour la page produit d’un site e-commerce &quot; /&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;La différence se joue sur &lt;strong&gt;la précision de la demande&lt;/strong&gt;. Un prompt efficace s&#039;articule autour de cinq dimensions. Elles font la différence entre un résultat générique et une base vraiment exploitable :&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;La tâche&lt;/strong&gt; : Ce que l’IA doit faire concrètement, générer un écran, proposer un flow, décliner un composant.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Le contexte&lt;/strong&gt; : Où s&#039;intègre cet écran ou ce parcours dans l&#039;expérience globale ? Quel est l&#039;état précédent ?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Les éléments clés du design&lt;/strong&gt; : Les caractéristiques visuelles ou fonctionnelles importantes que l&#039;IA doit intégrer dans sa proposition.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Les comportements attendus&lt;/strong&gt; : Comment réagissent ces éléments lors de l&#039;interaction (hover, tap, scroll, états vides, erreurs…)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Les contraintes :&lt;/strong&gt; Le support, la mise en page, le style visuel, les guidelines de marque. Plus ces contraintes sont précises, plus le résultat est pertinent.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;J&#039;aime les métaphores, alors en voici une : l&#039;IA ressemble à un nouveau collaborateur. Il ne connaît pas encore le contexte, les clients, les process. Sans brief précis, il produit quelque chose de générique. Bien briefé, il va vite et produit une base exploitable.&lt;/p&gt;
&lt;p&gt;Apprendre à prompter, c&#039;est apprendre à collaborer avec l&#039;IA, formuler ce qu&#039;on veut, donner le bon niveau de contexte, et itérer ensemble.&lt;/p&gt;
&lt;h2&gt;Intégrer l&#039;IA à chaque étape&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Maintenant qu&#039;on a posé ce cadre, voyons comment ça se traduit dans le travail. J&#039;ai organisé cette exploration en trois phases : explorer, concevoir et produire. L&#039;IA n&#039;y joue pas le même rôle à chaque étape.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Une précision importante avant de commencer : &amp;quot;plus vite&amp;quot; ne veut pas dire &amp;quot;sans effort&amp;quot;. Une partie du temps gagné en génération est réinvestie en correction, ajustement et validation. L&#039;IA produit une base et non un livrable.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Explorer plus vite et plus largement&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Un brief flou est l&#039;une des principales sources de perte de temps en début de projet. Avant, cela voulait dire plusieurs allers-retours avant même de commencer à concevoir. Aujourd&#039;hui, on peut envoyer le brief tel quel à un agent conversationnel, demander une structure claire avec l&#039;utilisateur cible, le problème, les objectifs attendus et les questions de clarification manquantes, et avoir une base de travail en quelques minutes.&lt;/p&gt;
&lt;p&gt;Sur les UX flows, même constat. L&#039;IA est capable de générer rapidement plusieurs scénarios, explorer des alternatives et identifier des états qu&#039;on aurait pu oublier (erreurs, compte vide, connexion perdue..). La décision reste entièrement humaine : simplifier, prioriser, arbitrer.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Concevoir et itérer sans blocage&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Pour cette phase de conception, j&#039;ai testé spécifiquement deux outils : Figma Make et Claude Design.&lt;/p&gt;
&lt;p&gt;Figma Make permet de générer plusieurs propositions d&#039;écrans à partir d&#039;une description ou de frames, de tester des patterns qu&#039;on n&#039;aurait pas spontanément tentés, et d&#039;explorer des déclinaisons visuelles rapidement. C&#039;est un véritable moteur d&#039;expérimentation. Par défaut, il génère des écrans génériques, sans personnalité, sans cohérence graphique. Cette limite se réduit selon ce qu&#039;on lui fournit un prompt détaillé ou en faisant plusieurs itérations.&lt;/p&gt;
&lt;p&gt;Claude Design va plus loin dans l&#039;aboutissement. La richesse de l&#039;interface et la finesse des ajustements possibles sont intéressantes. C&#039;est à ce jour la solution qui produit les prototypes les plus aboutis parmi celles que j&#039;ai testées. Si le prompt semble insuffisant, Claude Design propose automatiquement un questionnaire pour affiner la demande avant de générer.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;js-dialog-target&quot; data-original-url=&quot;/media/original/2026/workflow-ia-ux-ui/article-ai-design-03.jpg&quot; data-original-width=&quot;1920&quot; data-original-height=&quot;1080&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;/media/cache/content-webp/2026/workflow-ia-ux-ui/article-ai-design-03.424b3206.webp&quot; /&gt;&lt;source type=&quot;image/jpeg&quot; srcset=&quot;/media/cache/content/2026/workflow-ia-ux-ui/article-ai-design-03.jpg&quot; /&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; style=&quot;width: 996px; ; aspect-ratio: calc(1920 / 1080)&quot; src=&quot;https://jolicode.com//media/cache/content/2026/workflow-ia-ux-ui/article-ai-design-03.jpg&quot; alt=&quot;Exemple de Claude&quot; /&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;Autre détail qui a son importance, Claude Design propose deux modes d&#039;itération complémentaires : le chat pour les changements globaux, et les commentaires inline pour les ajustements précis sur un élément spécifique. En pratique, ça permet de générer rapidement des visuels utiles pour aligner une équipe, transformer une idée produit en prototype testable.&lt;/p&gt;
&lt;p&gt;&lt;picture class=&quot;js-dialog-target&quot; data-original-url=&quot;/media/original/2026/workflow-ia-ux-ui/article-ai-design-04.jpg&quot; data-original-width=&quot;1920&quot; data-original-height=&quot;1080&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;/media/cache/content-webp/2026/workflow-ia-ux-ui/article-ai-design-04.5660d1fd.webp&quot; /&gt;&lt;source type=&quot;image/jpeg&quot; srcset=&quot;/media/cache/content/2026/workflow-ia-ux-ui/article-ai-design-04.jpg&quot; /&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; style=&quot;width: 996px; ; aspect-ratio: calc(1920 / 1080)&quot; src=&quot;https://jolicode.com//media/cache/content/2026/workflow-ia-ux-ui/article-ai-design-04.jpg&quot; alt=&quot;Exemple de Claude&quot; /&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;Dans les deux cas, ce que ces outils produisent est une base de travail, pas un livrable finalisé. Le designer reste celui qui la transforme en proposition exploitable.&lt;/p&gt;
&lt;p&gt;Au-delà des écrans, l&#039;IA change aussi la façon de rédiger les interfaces. Sur le microcopy, ces petits textes qui guident l&#039;utilisateur à chaque étape, c&#039;est une aide précieuse. En définissant le ton et le style de communication de la marque dans le prompt, on peut générer rapidement des textes cohérents pour tous les états d&#039;interface : succès, erreur, chargement, état vide.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Produire et livrer plus efficacement&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Le handoff, ce moment où le designer passe le relais au développeur, est souvent un moment de friction. L&#039;IA ne le supprime pas, mais elle le fluidifie. En connectant Figma à Claude via le protocole MCP (Model Context Protocol), Claude peut lire directement la structure du fichier (composants, calques, propriétés…) et produire une base de documentation de specs. C&#039;est une piste que je n&#039;ai pas encore testée personnellement, mais qui mérite d&#039;être mentionnée. La qualité du résultat dépendrait directement de la structure du fichier Figma : un fichier bien nommé avec des composants propres donnerait un résultat exploitable.&lt;/p&gt;
&lt;p&gt;C&#039;est d&#039;ailleurs une règle qui vaut pour tout l&#039;article : l&#039;IA amplifie que ce qui est déjà structuré. Un design system solide n&#039;est plus seulement un outil de cohérence visuelle, c&#039;est ce qui rend le travail exploitable par l&#039;IA.&lt;/p&gt;
&lt;h2&gt;Et côté client, qu’est-ce que ça change vraiment ?&lt;/h2&gt;
&lt;p&gt;Les deux anecdotes d&#039;introduction ne sont pas des cas isolés, elles disent quelque chose d&#039;important : le niveau de préparation et d&#039;attente des clients change. Quand un client arrive avec des maquettes générées par IA pour illustrer son idée, il ne cherche pas à faire le travail du designer. Il cherche à être compris plus vite, à aligner plus tôt, à éviter les allers-retours.&lt;/p&gt;
&lt;p&gt;Pour le designer, ça change la nature de la conversation. On ne part plus d&#039;une page blanche commune, on part d&#039;idées déjà mises en forme, parfois précises, parfois approximatives mais toujours révélatrices de ce que le client a en tête. Le client montre une direction, une intention mais pas une solution. C&#039;est au designer de définir ce qu&#039;il y a derrière.&lt;/p&gt;
&lt;p&gt;La prochaine étape naturelle, que j&#039;imagine, c&#039;est l&#039;atelier client en live : générer des variantes d&#039;écrans directement en réunion pour itérer en temps réel sur une direction. L&#039;enjeu est simple : aligner plus vite.&lt;/p&gt;
&lt;h2&gt;Pour conclure&lt;/h2&gt;
&lt;p&gt;L&#039;IA transforme réellement la pratique du design. Elle accélère certaines étapes, structure des réflexions qui prenaient du temps, et ouvre des possibilités d&#039;exploration.&lt;/p&gt;
&lt;p&gt;Elle ne connaît pas les utilisateurs, leurs habitudes, leurs frustrations, ce qui les fait décrocher. La créativité graphique, la sensibilité visuelle, la cohérence d&#039;une marque, tout cela reste entièrement humain. Mais elle propose des directions qu&#039;un designer seul n&#039;aurait pas explorées, pas parce qu&#039;elles sont meilleures, mais parce qu&#039;elle n&#039;a pas nos biais.&lt;/p&gt;
&lt;p&gt;Sur un prochain sujet, nous pourrons approfondir un aspect particulier : comment configurer Claude avec des instructions personnalisées (system prompts, custom instructions) pour lui donner un contexte permanent et des compétences adaptées à la pratique du designer.&lt;/p&gt;

        </content>
    </entry>    <entry>
        <id>https://jolicode.com/blog/claude-code-cursor-symfony-ai-vercel-ai-sdk-3-formations-pour-garder-la-main</id>
        <published>2026-04-28T15:42:00+02:00</published>
        <updated>2026-04-28T15:42:00+02:00</updated>
        <link type="text/html" rel="alternate" href="https://jolicode.com/blog/claude-code-cursor-symfony-ai-vercel-ai-sdk-3-formations-pour-garder-la-main"/>
        <title>Claude Code, Cursor, Symfony/AI, Vercel AI SDK : 3 formations pour garder la main</title>
        <author>
            <name>JoliCode Team</name>
            <uri>https://jolicode.com/</uri>
        </author>            <category term="symfony" />            <category term="ia" />            <category term="formation" />        <summary><![CDATA[Trois formations IA sont disponibles dès maintenant sur JoliCampus, avec des sessions ouvertes à l&#039;inscription. Elles sont construites sur ce qu&#039;on pratique chez JoliCode et Premier Octet : des projets…]]></summary>
        <content type="html">
            &lt;p&gt;Trois formations IA sont disponibles dès maintenant sur &lt;a href=&quot;https://jolicampus.com&quot;&gt;JoliCampus&lt;/a&gt;, avec des sessions ouvertes à l&#039;inscription. Elles sont construites sur ce qu&#039;on pratique chez JoliCode et Premier Octet : des projets clients qui tournent en production avec des agents de code IA, des outils qu&#039;on utilise tous les jours, des patterns qu&#039;on a éprouvés, testés et parfois jetés !&lt;/p&gt;
&lt;p&gt;Voici ce qu&#039;elles contiennent :&lt;/p&gt;
&lt;h2&gt;Maîtriser les agents IA pour le développement&lt;/h2&gt;
&lt;p&gt;&lt;picture class=&quot;js-dialog-target&quot; data-original-url=&quot;/media/original/2026/formation-ia-article/1.png&quot; data-original-width=&quot;1600&quot; data-original-height=&quot;900&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;/media/cache/content-webp/2026/formation-ia-article/1.00556eaa.webp&quot; /&gt;&lt;source type=&quot;image/png&quot; srcset=&quot;/media/cache/content/2026/formation-ia-article/1.png&quot; /&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; style=&quot;width: 996px; ; aspect-ratio: calc(1600 / 900)&quot; src=&quot;https://jolicode.com//media/cache/content/2026/formation-ia-article/1.png&quot; alt=&quot;les agents IA pour le développement&quot; /&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;La porte d&#039;entrée ! Une journée pour sortir de l&#039;autocomplete et entrer dans le travail avec des agents. Au programme : fonctionnement réel d&#039;un agent (mémoire, contexte, permissions), standardisation des conventions d&#039;équipe via le fichier &lt;code&gt;AGENTS.md&lt;/code&gt; (agnostique, fonctionne avec Claude Code, Codex, Cursor), utilisation de l&#039;agent comme QA automatisée avec génération de tests, lecture des logs et boucle d&#039;auto-réparation sous supervision, puis création de commandes personnalisées pour industrialiser chez vous les revues de code, la détection de N+1, de failles XSS, et les patterns propres à votre équipe.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://jolicampus.com/formations/maitriser-les-agents-ia-pour-le-developpement&quot;&gt;Voir la formation&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;L&#039;IA pour développeurs frontend, avec Cursor et le Vercel AI SDK&lt;/h2&gt;
&lt;p&gt;&lt;picture class=&quot;js-dialog-target&quot; data-original-url=&quot;/media/original/2026/formation-ia-article/2.png&quot; data-original-width=&quot;1600&quot; data-original-height=&quot;900&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;/media/cache/content-webp/2026/formation-ia-article/2.97fd7971.webp&quot; /&gt;&lt;source type=&quot;image/png&quot; srcset=&quot;/media/cache/content/2026/formation-ia-article/2.png&quot; /&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; style=&quot;width: 996px; ; aspect-ratio: calc(1600 / 900)&quot; src=&quot;https://jolicode.com//media/cache/content/2026/formation-ia-article/2.png&quot; alt=&quot;IA pour développeurs frontend&quot; /&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;Les deux faces du sujet. Jour 1 côté workflow : Cursor dans ses trois modes (Ask, Plan, Agent), commandes custom, intégration d&#039;outils via MCP, &lt;code&gt;.cursorrules&lt;/code&gt; pour que l&#039;agent respecte l&#039;architecture du projet, gestion du contexte sur les sessions longues.&lt;/p&gt;
&lt;p&gt;Jour 2 côté produit : construire un vrai assistant avec le Vercel AI SDK (streaming, tool calling, architecture RAG sur vos contenus, typage strict avec Zod), déploiement et les questions qui vont avec (coûts API, monitoring, stratégies de cache).&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://jolicampus.com/formations/ia-developpement-frontend-cursor-vercel-ai-sdk&quot;&gt;Voir la formation&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Maîtriser l&#039;IA avec Symfony&lt;/h2&gt;
&lt;p&gt;&lt;picture class=&quot;js-dialog-target&quot; data-original-url=&quot;/media/original/2026/formation-ia-article/3.png&quot; data-original-width=&quot;1600&quot; data-original-height=&quot;900&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;/media/cache/content-webp/2026/formation-ia-article/3.1a9a7438.webp&quot; /&gt;&lt;source type=&quot;image/png&quot; srcset=&quot;/media/cache/content/2026/formation-ia-article/3.png&quot; /&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; style=&quot;width: 996px; ; aspect-ratio: calc(1600 / 900)&quot; src=&quot;https://jolicode.com//media/cache/content/2026/formation-ia-article/3.png&quot; alt=&quot;IA avec Symfony&quot; /&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;Pour intégrer l&#039;IA générative dans vos applications Symfony avec la même rigueur que le reste de votre code. On s&#039;appuie &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://ai.symfony.com/&quot;&gt;sur Symfony/AI&lt;/a&gt;, le composant officiel de l&#039;écosystème, auquel on contribue directement.&lt;/p&gt;
&lt;p&gt;Socle de 2 jours : fondamentaux des LLM, ChatInterface, typage fort des sorties en objets PHP, RAG complet sur vos documents avec pgvector. Puis deux modules optionnels : le premier transforme votre application en orchestrateur d&#039;agents capables d&#039;appeler votre code PHP et vos APIs internes, le second aborde MCP, le McpBundle, les stratégies de test, le monitoring en production et la maîtrise des coûts.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://jolicampus.com/formations/maitriser-ia-symfony&quot;&gt;Voir la formation&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Et si vous ne codez pas ?&lt;/h2&gt;
&lt;p&gt;POs, chefs de projets, dirigeantes et dirigeants de boîte tech : l&#039;IA change aussi la façon dont vos équipes travaillent, à quelle cadence, sur quelle échelle de temps. Notre formation &lt;a href=&quot;https://jolicampus.com/formations/culture-engineering&quot;&gt;Culture Engineering&lt;/a&gt; a un module dédié pour comprendre ce qui bouge pour mieux collaborer avec vos équipes tech.&lt;/p&gt;
&lt;h2&gt;Pourquoi chez nous ?&lt;/h2&gt;
&lt;p&gt;On forme sur ce qu&#039;on pratique. Nos projets tournent en production avec ces outils, on contribue directement à Symfony/AI, et on publie sur &lt;a href=&quot;https://jolicode.com/blog/tag/ia&quot;&gt;notre blog&lt;/a&gt; ce qu&#039;on apprend. Ces formations vont évoluer avec l&#039;écosystème. Certains modules seront réécrits dans six mois. Un participant d&#039;aujourd&#039;hui peut revenir dans un an sur une session mise à jour, et ce sera la suite logique, pas une répétition 🙂&lt;/p&gt;
&lt;p&gt;Toutes nos formations &lt;a href=&quot;https://jolicampus.com/formations/financement&quot;&gt;sont certifiées Qualiopi, finançables via les OPCO&lt;/a&gt;, et modulables en intra-entreprise. Un doute sur la formation qui correspond à votre équipe ? &lt;a href=&quot;https://jolicampus.com/contact&quot;&gt;Écrivez-nous !&lt;/a&gt;.&lt;/p&gt;

        </content>
    </entry>    <entry>
        <id>https://jolicode.com/blog/plan-de-migration-vers-tailwind-css-v4-la-methode-presque-sans-douleur</id>
        <published>2026-04-27T10:20:00+02:00</published>
        <updated>2026-04-27T10:20:00+02:00</updated>
        <link type="text/html" rel="alternate" href="https://jolicode.com/blog/plan-de-migration-vers-tailwind-css-v4-la-methode-presque-sans-douleur"/>
        <title>Plan de migration vers Tailwind CSS v4 🚀 : la méthode (presque) sans douleur</title>
        <author>
            <name>JoliCode Team</name>
            <uri>https://jolicode.com/</uri>
        </author>            <category term="framework" />            <category term="méthodologie" />            <category term="css" />            <category term="tailwind" />        <summary><![CDATA[Ça y est, le grand jour est arrivé ! Vous avez enfin décidé de vous attaquer à cette fameuse dette technique qui vous fait faire des cauchemars la nuit. 😅
Beaucoup de nos projets (et sans doute les vôtres)…]]></summary>
        <content type="html">
            &lt;p&gt;Ça y est, le grand jour est arrivé ! Vous avez enfin décidé de vous attaquer à cette fameuse dette technique qui vous fait faire des cauchemars la nuit. 😅&lt;/p&gt;
&lt;p&gt;Beaucoup de nos projets (et sans doute les vôtres) reposent encore sur d’anciens frameworks CSS basés sur &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://sass-lang.com/&quot;&gt;Sass&lt;/a&gt;, comme &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://getbootstrap.com/docs/4.6/getting-started/introduction/&quot;&gt;Bootstrap v4&lt;/a&gt; ou d&#039;autres solutions maison (coucou &lt;a href=&quot;https://jolicode.com/blog/notre-framework-dinterface-atomic-builder-partie-2&quot;&gt;Atomic Builder&lt;/a&gt; 👋). Et soyons honnêtes : maintenir et mettre à jour ces projets relève souvent du parcours du combattant. On fait face à un manque cruel de flexibilité, la dette technique s’accumule, et les dépendances commencent à poser plus de soucis qu&#039;elles n&#039;en résolvent.&lt;/p&gt;
&lt;p&gt;Sans oublier que Sass, bien qu’ayant été notre fidèle compagnon pendant de très (très) nombreuses années, devient de moins en moins indispensable avec l&#039;évolution fulgurante du CSS natif. Nous avons d’ailleurs eu l’occasion d’en parler dans notre article expliquant pourquoi &lt;a href=&quot;https://jolicode.com/blog/passer-a-postcss-pour-un-projet-sans-sass&quot;&gt;passer à PostCSS&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Le choix s&#039;est donc naturellement porté vers &lt;strong&gt;Tailwind CSS v4&lt;/strong&gt;. C&#039;est une solution qui a fait ses preuves chez JoliCode (&lt;a href=&quot;https://jolicode.com/blog/jai-teste-tailwind-css&quot;&gt;J&#039;ai testé Tailwind CSS&lt;/a&gt;) et, cerise sur le gâteau, cette nouvelle version ne nécessite aucune dépendance liée à Sass.&lt;/p&gt;
&lt;p&gt;L’année dernière, nous avons amorcé des phases de migration pour plusieurs de nos projets clients. Aujourd’hui, j’ai envie de partager avec vous quelques retours d’expérience et une méthodologie (testée et approuvée ✅) pour que ces migrations se passent le mieux possible !&lt;/p&gt;
&lt;h2&gt;Phase 1 : Migration des feuilles de styles CSS 🎨&lt;/h2&gt;
&lt;p&gt;L’objectif de cette première phase est simple : utiliser du CSS natif et dire officiellement au revoir à notre bon vieux Sass. 👋&lt;/p&gt;
&lt;p&gt;La toute première étape consiste à migrer la configuration globale de votre projet (généralement définie dans des fichiers tels que &lt;code&gt;variables.scss&lt;/code&gt; ou &lt;code&gt;global.scss&lt;/code&gt;) vers un système basé sur des &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://developer.mozilla.org/fr/docs/Web/CSS/Reference/Properties/--*&quot;&gt;&lt;em&gt;custom properties&lt;/em&gt;&lt;/a&gt; (variables CSS), en ciblant la racine du document HTML via la pseudo-classe &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://developer.mozilla.org/fr/docs/Web/CSS/Reference/Selectors/:root&quot;&gt;&lt;code&gt;:root&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Avant (Sass) :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;$color-primary: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;#f7d325&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;$color-secondary: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;#ff2951&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;$font-family-sans-serif: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;Source Sans Pro&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;sans-serif&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Après (CSS natif) :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;:root&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  --color-primary: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;#f7d325&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  --color-secondary: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;#ff2951&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  --font-sans: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;Source Sans Pro&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;sans-serif&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;div class=&quot;c-alert c-alert--note&quot;&gt;
    &lt;p class=&quot;c-alert__title&quot;&gt;
                    &lt;span class=&quot;c-icon c-icon--monospace&quot;&gt;
                &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; aria-hidden=&quot;true&quot; class=&quot;c-icon__svg&quot; focusable=&quot;false&quot; viewBox=&quot;0 0 70 71&quot;&gt;&lt;path fill-rule=&quot;nonzero&quot; d=&quot;M35 .9c19.3 0 35 15.7 35 35s-15.7 35-35 35-35-15.7-35-35S15.7.9 35 .9m0 5c-16.552 0-30 13.449-30 30s13.448 30 30 30c16.552.103 30-13.448 30-30 0-16.551-13.448-30-30-30m0 24.9c1.7 0 3 1.3 3 3v15.3c0 1.7-1.3 3-3 3s-3-1.3-3-3V33.8c0-1.7 1.3-3 3-3m0-11c.8 0 1.6.3 2.3.9.6.5.9 1.3.9 2.1 0 .2-.1.4-.1.6-.1.2-.1.4-.2.6s-.2.3-.3.5-.3.4-.4.5c-1.1 1.1-3.1 1.1-4.2 0-.2-.2-.3-.3-.4-.5s-.2-.3-.3-.5-.2-.4-.2-.6c-.1-.2-.1-.4-.1-.6 0-.8.3-1.6.9-2.1.5-.6 1.3-.9 2.1-.9&quot;/&gt;&lt;/svg&gt;
            &lt;/span&gt;
                        &lt;strong&gt;Info&lt;/strong&gt;
    &lt;/p&gt;
    &lt;div class=&quot;c-alert__content&quot;&gt;
                &lt;p&gt;&lt;br /&gt;
Utilisez dès maintenant la &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://tailwindcss.com/docs/theme#default-theme-variable-reference&quot;&gt;nomenclature de Tailwind CSS v4&lt;/a&gt; pour nommer vos variables CSS. Ça vous fera gagner un temps précieux pour la suite. 👌&lt;/p&gt;
        &lt;/div&gt;
&lt;/div&gt;

&lt;h3&gt;Cas n°1 : Les variables et fonctions&lt;/h3&gt;
&lt;p&gt;Une fois votre thème mis en place, votre première mission sera de remplacer tous vos &lt;code&gt;$&lt;/code&gt; par des &lt;code&gt;var(--)&lt;/code&gt;. C&#039;est aussi l&#039;occasion de traduire vos fonctions Sass en CSS moderne. 👀&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Avant (Sass) :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;.button&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;  width&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: math.&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;  background-color&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: $color-primary;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  &amp;#x26;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;:hover&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  &amp;#x26;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;:focus-visible&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  &amp;#x26;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;:active&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;    background-color&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;darken&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;($color-primary, &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Après (CSS natif) :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;.button&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;  /* Le CSS natif s&#039;occupe des calculs dynamiquement ! */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;  width&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;calc&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; /&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; 3&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;  background-color&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(--color-primary);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  &amp;#x26;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;:hover&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  &amp;#x26;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;:focus-visible&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  &amp;#x26;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;:active&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;    /* Magie ! Les couleurs relatives en CSS natif */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;    background-color&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;hsl&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-12&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt; var&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(--color-primary) &lt;/span&gt;&lt;span class=&quot;syntax-12&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;syntax-12&quot;&gt; s&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt; calc&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-12&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; 15&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)); &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Aujourd&#039;hui, le CSS natif est devenu suffisamment mature pour remplacer la quasi-totalité des fonctions Sass. C’est particulièrement vrai pour les manipulations de couleurs, qui s’écrivent désormais très simplement grâce aux &lt;a href=&quot;https://jolicode.com/blog/les-couleurs-relatives-en-css&quot;&gt;couleurs relatives en CSS&lt;/a&gt;. 🎨&lt;/p&gt;
&lt;h3&gt;Cas n°2 : Le piège du sélecteur d’imbrication &lt;code&gt;&amp;amp;&lt;/code&gt; et du BEM&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;La bonne nouvelle&lt;/strong&gt;, c&#039;est que le CSS natif gère désormais très bien le &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://developer.mozilla.org/fr/docs/Web/CSS/Reference/Selectors/Nesting_selector&quot;&gt;&lt;em&gt;nesting&lt;/em&gt;&lt;/a&gt; (l&#039;imbrication). L&#039;esperluette (&lt;code&gt;&amp;amp;&lt;/code&gt;) pour cibler des états comme &lt;code&gt;&amp;amp;:hover&lt;/code&gt; ou &lt;code&gt;&amp;amp;:focus&lt;/code&gt; fonctionne parfaitement sans Sass.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;La mauvaise nouvelle ?&lt;/strong&gt; Si vous utilisiez le &lt;code&gt;&amp;amp;&lt;/code&gt; pour concaténer des classes, typiquement avec la &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://getbem.com/&quot;&gt;méthodologie BEM&lt;/a&gt; (&lt;code&gt;&amp;amp;__element&lt;/code&gt; ou &lt;code&gt;&amp;amp;--modifier&lt;/code&gt;), le CSS natif ne comprendra pas cette syntaxe. Il va falloir « désimbriquer » ces éléments.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Avant (Sass) :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;.link&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;  color&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: $color-primary;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  &amp;#x26;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;:hover&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  &amp;#x26;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;:focus-visible&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  &amp;#x26;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;:active&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;    color&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: $color-secondary;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;  /* Sass va compiler ce code en &quot;.link--secondary&quot; */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  &amp;#x26;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;--secondary {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;    color&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: $color-secondary;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Après (CSS natif) :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;.link&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;  color&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(--color-primary);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;  /* Ce code fonctionne toujours en CSS natif ! */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  &amp;#x26;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;:hover&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  &amp;#x26;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;:focus-visible&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  &amp;#x26;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;:active&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;    color&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(--color-secondary);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;/* Il faut sortir la classe enfant de l&#039;imbrication */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;.link--secondary&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;  color&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(--color-secondary);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Cas n°3 : Les media queries&lt;/h3&gt;
&lt;p&gt;Pour les &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://developer.mozilla.org/fr/docs/Web/CSS/Guides/Media_queries/Using&quot;&gt;&lt;em&gt;media queries&lt;/em&gt;&lt;/a&gt; générées via des mixins ou des fonctions Sass (du type &lt;code&gt;@include media-breakpoint-up(md)&lt;/code&gt;), passez simplement les valeurs en dur pour le moment (&lt;code&gt;@media (min-width: 768px)&lt;/code&gt;). Nous nous en occuperons plus tard, lors de l&#039;intégration de Tailwind.&lt;/p&gt;
&lt;h3&gt;Cas n°4 : Les mixins, boucles et règles complexes&lt;/h3&gt;
&lt;p&gt;Pour les cas très spécifiques (boucles &lt;code&gt;@for&lt;/code&gt;, mixins complexes), la solution la plus pragmatique est de récupérer la version déjà compilée et de la coller dans votre fichier CSS.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Avant (Sass) :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;@for&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $i &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; 1&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; through&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; 3&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;  .button--size-&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;#{$i} {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;    padding&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: #{$i}rem;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Après (CSS natif) :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;.button--size-1&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; { &lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;.button--size-2&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; { &lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;.button--size-3&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; { &lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;; }&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;À la fin de cette phase, &lt;strong&gt;le code CSS de votre projet n&#039;utilise techniquement plus aucune fonctionnalité propre à Sass. 👏&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;Phase 2 : Migration (provisoire) des classes utilitaires 🧰&lt;/h2&gt;
&lt;p&gt;C&#039;est l&#039;étape de la « prise de masse » avant la sèche. 💪&lt;/p&gt;
&lt;p&gt;L&#039;idée est de récupérer le CSS compilé de toutes les classes utilitaires de votre ancien framework et de les stocker dans un nouveau dossier, par exemple &lt;code&gt;utilities/&lt;/code&gt;. Pour garder l&#039;esprit clair, séparez-les par thématique : &lt;code&gt;utilities/typography.css&lt;/code&gt;, &lt;code&gt;utilities/spacing.css&lt;/code&gt;, etc.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Exemple d&#039;un fichier &lt;code&gt;utilities/spacing.css&lt;/code&gt; (récupéré depuis Bootstrap v4) :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;.mt-1&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; { &lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;0.25&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; !important&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;.mt-2&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; { &lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; !important&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;.mb-3&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; { &lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;margin-bottom&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; !important&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;/* ... */&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Votre CSS global va grossir temporairement. C&#039;est normal, ne paniquez pas ! Ces fichiers agiront comme un filet de sécurité visuel en attendant que Tailwind prenne le relais. 😮‍💨&lt;/p&gt;
&lt;h2&gt;Phase 3 : On débranche l’ancien framework CSS 💔&lt;/h2&gt;
&lt;p&gt;Si les phases 1 et 2 ont été faites minutieusement, vous pouvez supprimer l&#039;ancien framework CSS de vos dépendances. Visuellement, rien ne devrait bouger. 🤞&lt;/p&gt;

&lt;div class=&quot;c-alert c-alert--warning&quot;&gt;
    &lt;p class=&quot;c-alert__title&quot;&gt;
                    &lt;span class=&quot;c-icon c-icon--monospace&quot;&gt;
                &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; aria-hidden=&quot;true&quot; class=&quot;c-icon__svg&quot; focusable=&quot;false&quot; viewBox=&quot;0 0 70 62&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;m41.198 3.519 27.854 47.924C71.752 56.135 68.377 62 62.806 62H7.098c-5.402 0-8.947-5.865-6.077-10.557L28.875 3.52c2.7-4.692 9.622-4.692 12.323 0Zm-8.586 2.944L5.427 52.936C4.274 54.725 5.592 57 7.734 57h54.37c2.306 0 3.624-2.275 2.471-4.063L37.39 6.464c-.988-1.95-3.79-1.95-4.778 0ZM33 45.9c1.1-1.1 3.1-1.1 4.2 0 .2.2.3.3.4.5s.2.3.3.5.2.4.2.6c.1.2.1.4.1.6 0 .8-.3 1.6-.9 2.1-.5.6-1.3.9-2.1.9s-1.6-.3-2.3-.9c-.6-.5-.9-1.3-.9-2.1 0-.2.1-.4.1-.6.1-.2.1-.4.2-.6s.2-.3.3-.5.3-.4.4-.5m2.2-27.1c1.7 0 3 1.3 3 3v15.3c0 1.7-1.3 3-3 3s-3-1.3-3-3V21.8c0-1.7 1.3-3 3-3&quot;/&gt;&lt;/svg&gt;
            &lt;/span&gt;
                        &lt;strong&gt;Avertissement&lt;/strong&gt;
    &lt;/p&gt;
    &lt;div class=&quot;c-alert__content&quot;&gt;
                &lt;p&gt;&lt;br /&gt;
&lt;strong&gt;Attention aux comportements JS !&lt;/strong&gt; Si votre ancien framework (comme Bootstrap) gérait des modales, des info-bulles ou des menus déroulants, la suppression de son CSS (et de ses scripts associés) risque de casser les animations ou le positionnement. Prévoyez un peu de temps de développement pour vérifier les interactions JavaScript et réécrire ces quelques composants. Profitez-en pour utiliser du JS vanilla ou du CSS moderne (&lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://developer.mozilla.org/fr/docs/Web/API/Popover_API&quot;&gt;l&#039;API Popover native&lt;/a&gt; est parfaite pour ça, par exemple !).&lt;/p&gt;
        &lt;/div&gt;
&lt;/div&gt;

&lt;h2&gt;Phase 4 : L&#039;adieu à Sass 🫡&lt;/h2&gt;
&lt;p&gt;C&#039;est l&#039;heure de désinstaller une fois pour toutes &lt;code&gt;sass&lt;/code&gt; (ou &lt;code&gt;node-sass&lt;/code&gt;). N’oubliez pas de renommer tous vos fichiers &lt;code&gt;.scss&lt;/code&gt; en &lt;code&gt;.css&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Lors de cette étape, il est très probable que le compilateur échoue lors de son premier lancement. Si la console se remplit d&#039;erreurs, pas de panique, c&#039;est un grand classique ! Cela s&#039;explique généralement par l&#039;une de ces trois raisons :&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;L&#039;import fantôme&lt;/strong&gt; : Votre &lt;em&gt;bundler&lt;/em&gt; (comme &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://webpack.js.org/&quot;&gt;Webpack&lt;/a&gt;) ou votre point d&#039;entrée JavaScript (le fameux &lt;code&gt;app.js&lt;/code&gt;) pointe toujours vers un fichier portant l’extension &lt;code&gt;.scss&lt;/code&gt;. Pensez à bien mettre à jour vos chemins d&#039;importation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Le reliquat de Sass&lt;/strong&gt; : Il reste quelques &lt;code&gt;$&lt;/code&gt;, &lt;code&gt;@use&lt;/code&gt;, etc. qui traînent dans vos fichiers CSS. Pensez à les supprimer.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Les commentaires&lt;/strong&gt; : Les commentaires d&#039;une seule ligne écrits avec &lt;code&gt;//&lt;/code&gt; étaient valides avec Sass, mais pas avec votre CSS natif.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;L&#039;erreur classique à corriger :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;// Ce commentaire était valide en Sass, mais fera planter votre CSS natif !&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;.element&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; { &lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(--color-primary); }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;/* Remplacez-le par la syntaxe standard ! */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;.element&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; { &lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(--color-primary); }&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Une fois ces petits ajustements faits, respirez un grand coup. Le plus dur techniquement est derrière vous. 🎉&lt;/p&gt;
&lt;h2&gt;Phase 5 : L&#039;entrée en scène de Tailwind CSS v4 🤩&lt;/h2&gt;
&lt;p&gt;Il est enfin temps d&#039;installer Tailwind CSS v4 et &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://postcss.org/&quot;&gt;PostCSS&lt;/a&gt; (indispensable dans nos projets Symfony avec &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://symfony.com/doc/current/frontend/encore/index.html&quot;&gt;Webpack Encore&lt;/a&gt;). Je vous conseille de suivre la &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://tailwindcss.com/docs/installation/using-postcss&quot;&gt;documentation officielle&lt;/a&gt; pour le &lt;em&gt;setup&lt;/em&gt; initial.&lt;/p&gt;
&lt;h3&gt;Le piège de l&#039;import global (et du Preflight)&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;La documentation officielle vous recommandera d’importer Tailwind de cette façon :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;@import&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &quot;tailwindcss&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;En utilisant cet import global, Tailwind embarque par défaut plusieurs &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://developer.mozilla.org/fr/docs/Web/CSS/Reference/At-rules/@layer&quot;&gt;&lt;em&gt;layers CSS&lt;/em&gt;&lt;/a&gt; (&lt;code&gt;theme&lt;/code&gt;, &lt;code&gt;base&lt;/code&gt;, &lt;code&gt;components&lt;/code&gt; et &lt;code&gt;utilities&lt;/code&gt;), injectant par la même occasion son propre &lt;em&gt;reset CSS&lt;/em&gt; (Preflight). Si votre projet possédait déjà un fichier de &lt;em&gt;reset&lt;/em&gt; (comme &lt;code&gt;normalize.css&lt;/code&gt;), vous risquez d’avoir des conflits.&lt;/p&gt;

&lt;div class=&quot;c-alert c-alert--note&quot;&gt;
    &lt;p class=&quot;c-alert__title&quot;&gt;
                    &lt;span class=&quot;c-icon c-icon--monospace&quot;&gt;
                &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; aria-hidden=&quot;true&quot; class=&quot;c-icon__svg&quot; focusable=&quot;false&quot; viewBox=&quot;0 0 70 71&quot;&gt;&lt;path fill-rule=&quot;nonzero&quot; d=&quot;M35 .9c19.3 0 35 15.7 35 35s-15.7 35-35 35-35-15.7-35-35S15.7.9 35 .9m0 5c-16.552 0-30 13.449-30 30s13.448 30 30 30c16.552.103 30-13.448 30-30 0-16.551-13.448-30-30-30m0 24.9c1.7 0 3 1.3 3 3v15.3c0 1.7-1.3 3-3 3s-3-1.3-3-3V33.8c0-1.7 1.3-3 3-3m0-11c.8 0 1.6.3 2.3.9.6.5.9 1.3.9 2.1 0 .2-.1.4-.1.6-.1.2-.1.4-.2.6s-.2.3-.3.5-.3.4-.4.5c-1.1 1.1-3.1 1.1-4.2 0-.2-.2-.3-.3-.4-.5s-.2-.3-.3-.5-.2-.4-.2-.6c-.1-.2-.1-.4-.1-.6 0-.8.3-1.6.9-2.1.5-.6 1.3-.9 2.1-.9&quot;/&gt;&lt;/svg&gt;
            &lt;/span&gt;
                        &lt;strong&gt;Info&lt;/strong&gt;
    &lt;/p&gt;
    &lt;div class=&quot;c-alert__content&quot;&gt;
                &lt;p&gt;&lt;br /&gt;
&lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://tailwindcss.com/docs/preflight#disabling-preflight&quot;&gt;Désactivez Preflight dans un premier temps&lt;/a&gt;, ainsi que l&#039;ensemble des &lt;em&gt;layers CSS&lt;/em&gt; importés pour limiter les régressions et les problématiques liées à la &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://developer.mozilla.org/fr/docs/Web/CSS/Guides/Cascade/Introduction&quot;&gt;cascade CSS&lt;/a&gt;.&lt;/p&gt;
        &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Pour cela, privilégiez des imports ciblés (sans les &lt;em&gt;layers CSS&lt;/em&gt;) :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;@import&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &quot;tailwindcss/theme.css&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;@import&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &quot;tailwindcss/utilities.css&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;La magie de la directive &lt;code&gt;@theme&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;La révolution de la v4, c&#039;est qu&#039;elle est &lt;em&gt;CSS-first&lt;/em&gt;. Fini l&#039;énorme fichier &lt;code&gt;tailwind.config.js&lt;/code&gt; à la racine de votre projet ! Le thème que vous aviez anticipé lors de la phase 1 s&#039;intègre désormais presque nativement grâce à la nouvelle directive &lt;code&gt;@theme&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Avant :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;:root&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  --color-primary: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;#f7d325&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  --color-secondary: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;#ff2951&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  --font-sans: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;Source Sans Pro&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;sans-serif&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Après :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;@theme static {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  --color-primary: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;#f7d325&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  --color-secondary: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;#ff2951&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  --font-sans: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;Source Sans Pro&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;sans-serif&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;div class=&quot;c-alert c-alert--note&quot;&gt;
    &lt;p class=&quot;c-alert__title&quot;&gt;
                    &lt;span class=&quot;c-icon c-icon--monospace&quot;&gt;
                &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; aria-hidden=&quot;true&quot; class=&quot;c-icon__svg&quot; focusable=&quot;false&quot; viewBox=&quot;0 0 70 71&quot;&gt;&lt;path fill-rule=&quot;nonzero&quot; d=&quot;M35 .9c19.3 0 35 15.7 35 35s-15.7 35-35 35-35-15.7-35-35S15.7.9 35 .9m0 5c-16.552 0-30 13.449-30 30s13.448 30 30 30c16.552.103 30-13.448 30-30 0-16.551-13.448-30-30-30m0 24.9c1.7 0 3 1.3 3 3v15.3c0 1.7-1.3 3-3 3s-3-1.3-3-3V33.8c0-1.7 1.3-3 3-3m0-11c.8 0 1.6.3 2.3.9.6.5.9 1.3.9 2.1 0 .2-.1.4-.1.6-.1.2-.1.4-.2.6s-.2.3-.3.5-.3.4-.4.5c-1.1 1.1-3.1 1.1-4.2 0-.2-.2-.3-.3-.4-.5s-.2-.3-.3-.5-.2-.4-.2-.6c-.1-.2-.1-.4-.1-.6 0-.8.3-1.6.9-2.1.5-.6 1.3-.9 2.1-.9&quot;/&gt;&lt;/svg&gt;
            &lt;/span&gt;
                        &lt;strong&gt;Info&lt;/strong&gt;
    &lt;/p&gt;
    &lt;div class=&quot;c-alert__content&quot;&gt;
                &lt;p&gt;&lt;br /&gt;
&lt;strong&gt;Gardez vos variables CSS accessibles partout !&lt;/strong&gt;  Pensez à générer vos variables CSS avec le comportement &lt;code&gt;static&lt;/code&gt;, comme indiqué dans la &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://tailwindcss.com/docs/theme#generating-all-css-variables&quot;&gt;documentation Tailwind&lt;/a&gt;. Ainsi, elles ne seront pas limitées aux classes utilitaires de Tailwind, mais resteront utilisables partout dans vos propres composants CSS personnalisés.&lt;/p&gt;
        &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;C&#039;est aussi le moment parfait pour utiliser la directive &lt;code&gt;@variant&lt;/code&gt; afin d&#039;uniformiser ces fameuses &lt;em&gt;media queries&lt;/em&gt; que nous avions mises en dur plus tôt !&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Avant :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;@media&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;min-width&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;768&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;  .card&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;    color&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(--color-primary);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Après :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;@variant md {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;  .card&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;    color&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(--color-primary);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ce petit changement vous garantit que tout votre CSS sur-mesure restera parfaitement synchronisé avec le comportement natif des classes utilitaires de Tailwind.&lt;/p&gt;
&lt;h2&gt;Phase 6 : Le nettoyage de printemps 🧹&lt;/h2&gt;
&lt;p&gt;Je préfère être honnête : cette étape demande de la patience. 🙃&lt;/p&gt;
&lt;p&gt;L&#039;objectif est de supprimer le dossier &lt;code&gt;utilities/&lt;/code&gt; créé à la phase 2. Pour ce faire, vous allez devoir remplacer dans tous vos templates HTML/Twig les anciennes classes par les nouvelles générées par Tailwind.&lt;/p&gt;
&lt;p&gt;Vos meilleurs alliés ici seront l&#039;outil de recherche de votre IDE, les expressions régulières (Regex), et bien sûr votre LLM (&lt;em&gt;Large Language Model&lt;/em&gt;) favori (ChatGPT, Claude, GitHub Copilot, etc.) pour automatiser un maximum le processus.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Avant (Bootstrap v4) :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; class&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;d-flex flex-column flex-md-row&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;&gt;...&amp;#x3C;/&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Après (Tailwind CSS v4) :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; class&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;flex flex-col md:flex-row&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;&gt;...&amp;#x3C;/&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Le boss final : Les grilles 😎&lt;/h3&gt;
&lt;p&gt;Il n&#039;y a pas de solution magique ici. Les vieux frameworks utilisaient généralement &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://developer.mozilla.org/fr/docs/Web/CSS/Guides/Flexible_box_layout&quot;&gt;Flexbox&lt;/a&gt; pour simuler un comportement de grille. Tailwind, lui, utilise le module natif &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://developer.mozilla.org/fr/docs/Web/CSS/Guides/Grid_layout&quot;&gt;&lt;em&gt;CSS Grid Layout&lt;/em&gt;&lt;/a&gt; (modèle de disposition en grille).&lt;/p&gt;
&lt;p&gt;Il va falloir repasser sur vos grilles manuellement. 😬&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;L&#039;ancienne approche (Flexbox) :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; class&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;row&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; class&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;col-12 col-md-6&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;&gt;...&amp;#x3C;/&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; class&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;col-12 col-md-6&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;&gt;...&amp;#x3C;/&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;La nouvelle approche (Grid) :&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; class&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;grid grid-cols-1 md:grid-cols-2&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;&gt;...&amp;#x3C;/&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;&gt;...&amp;#x3C;/&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;C&#039;est fastidieux, mais le DOM en ressort considérablement allégé et plus lisible. 🥳&lt;/p&gt;
&lt;h2&gt;Conclusion : Tout ça pour ça ? 🤔&lt;/h2&gt;
&lt;p&gt;Oui, mille fois oui. Migrer vers Tailwind CSS v4 n&#039;est pas un parcours de santé pour un projet existant. Mais les avantages sont colossaux.&lt;/p&gt;
&lt;p&gt;Vous dites adieu à l&#039;usine à gaz qu&#039;était devenu Sass au fil des années. Le poids final de votre CSS sera drastiquement réduit puisque Tailwind ne compile que ce que vous utilisez réellement. Sans parler des performances pures : avec son nouveau moteur écrit en Rust, les temps de compilation sont si rapides qu’on les remarque à peine.&lt;/p&gt;
&lt;p&gt;Enfin, la &lt;em&gt;Developer Experience&lt;/em&gt; (DX) de vos équipes s&#039;en trouvera transformée. C&#039;est un investissement en temps conséquent, mais c&#039;est un cadeau inestimable que vous faites au futur de votre projet. 🎁&lt;/p&gt;
&lt;h3&gt;Et concrètement, comment on vend ça à sa direction ?&lt;/h3&gt;
&lt;p&gt;C&#039;est souvent la question qui fâche. On sait que le chantier est nécessaire, mais il est difficile d&#039;estimer le temps que cela va prendre sans y laisser des plumes, d&#039;où &lt;strong&gt;l&#039;effet tunnel&lt;/strong&gt; qui effraie les équipes produit.&lt;/p&gt;
&lt;p&gt;Pour débloquer la situation, nous avons l&#039;habitude chez JoliCode de commencer par un &lt;strong&gt;audit flash (1 à 2 jours)&lt;/strong&gt;. L&#039;objectif est de poser les choses à plat pour vous fournir un plan de bataille concret à défendre en interne :&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Un état des lieux clair&lt;/strong&gt; de la dette front actuelle (dépendances, risques, obsolescence).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Une estimation chiffrée&lt;/strong&gt; de la migration, découpée par phase.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Un plan de déploiement progressif&lt;/strong&gt; qui ne bloque pas votre &lt;em&gt;roadmap&lt;/em&gt; produit.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Les bénéfices attendus&lt;/strong&gt; (gains de performance, vélocité des équipes, etc.).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Si vous avez besoin d&#039;aide pour cadrer votre propre migration, &lt;a href=&quot;https://jolicode.com/contact&quot;&gt;n&#039;hésitez pas à nous faire signe&lt;/a&gt; !&lt;/p&gt;
&lt;p&gt;J’espère que ce retour d’expérience vous sera utile et vous donnera le courage de sauter le pas. N&#039;hésitez pas à partager vos propres astuces ou vos galères de migration dans les commentaires ! 🙂&lt;/p&gt;

        </content>
    </entry>    <entry>
        <id>https://jolicode.com/blog/notre-retour-sur-le-symfonylive-paris-2026</id>
        <published>2026-04-08T15:42:00+02:00</published>
        <updated>2026-04-08T15:42:00+02:00</updated>
        <link type="text/html" rel="alternate" href="https://jolicode.com/blog/notre-retour-sur-le-symfonylive-paris-2026"/>
        <title>Notre retour sur le SymfonyLive Paris 2026</title>
        <author>
            <name>JoliCode Team</name>
            <uri>https://jolicode.com/</uri>
        </author>            <category term="conférence" />            <category term="symfony" />        <summary><![CDATA[Les années passent, mais certaines traditions restent immuables. Il y a quelques jours, la communauté s&#039;est de nouveau réunie à la Cité Universitaire pour l&#039;édition 2026 du Symfony Live Paris.
Si le monde…]]></summary>
        <content type="html">
            &lt;p&gt;Les années passent, mais certaines traditions restent immuables. Il y a quelques jours, la communauté s&#039;est de nouveau réunie à la Cité Universitaire pour l&#039;édition 2026 du Symfony Live Paris.&lt;/p&gt;
&lt;p&gt;Si le monde de la tech avance à toute vitesse, le cru 2026 conserve la recette qui a fait son succès. Nous étions, comme à notre habitude, présents au rendez-vous. Voici notre retour sur une édition qui prouve que Symfony reste à la pointe des évolutions.&lt;/p&gt;
&lt;h2&gt;Keynote de Fabien Potencier&lt;/h2&gt;
&lt;p&gt;&lt;picture class=&quot;js-dialog-target&quot; data-original-url=&quot;/media/original/2026/symfony-live-paris-2026/Fabien_TUI.jpg&quot; data-original-width=&quot;3143&quot; data-original-height=&quot;1922&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;/media/cache/content-webp/2026/symfony-live-paris-2026/Fabien_TUI.4a744ec6.webp&quot; /&gt;&lt;source type=&quot;image/jpeg&quot; srcset=&quot;/media/cache/content/2026/symfony-live-paris-2026/Fabien_TUI.jpg&quot; /&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; style=&quot;width: 996px; ; aspect-ratio: calc(3143 / 1922)&quot; src=&quot;https://jolicode.com//media/cache/content/2026/symfony-live-paris-2026/Fabien_TUI.jpg&quot; alt=&quot;Fabien pendant la Keynote&quot; /&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;Fabien Potencier nous a présenté un composant Symfony que beaucoup de gens attendaient impatiemment depuis sa première annonce datant de la &lt;a href=&quot;https://jolicode.com/blog/du-code-des-gaufres-et-des-bds-nous-etions-a-la-symfonycon-a-bruxelles#keynote-d-ouverture-facon-fabpot&quot;&gt;SymfonyCon 2023&lt;/a&gt; : Symfony TUI (pour Terminal User Interface) !&lt;/p&gt;
&lt;p&gt;Avec l&#039;arrivée récente et massive de l’IA dans les habitudes de travail de beaucoup de développeurs, Fabien a trouvé une raison parfaite de relancer son travail sur le composant TUI pour permettre une utilisation plus ergonomique et avancée des LLMs directement depuis un terminal.&lt;/p&gt;
&lt;p&gt;On a d’ailleurs eu le droit à une démonstration de son propre coding agent pour voir en direct ce à quoi on pourrait s’attendre avec l&#039;adoption de ce composant pour discuter avec des LLMs. Et le rendu rivalise avec ce qui peut aujourd’hui être proposé directement dans nos IDEs.&lt;/p&gt;
&lt;p&gt;Mais au-delà de l’intégration évidente avec l’IA, le composant TUI, c’est aussi une évolution du composant Symfony Console que l’on utilise tous (pour rappel, il s’agit de l’un des  premiers composants de l’écosystème Symfony, sorti il y a 15 ans maintenant). L’objectif ici, c’est de laisser Console s’occuper des parties commandes/arguments/output, pour concentrer toute la partie affichage, interaction et interactivité dans TUI.&lt;/p&gt;
&lt;p&gt;Lors de ce talk assez orienté technique, Fabien a expliqué comment TUI fonctionne sous le capot. Sans entrer dans les détails ici, on pourra retenir :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Il existe trois manières de gérer le style: à la manière stylesheet avec des sélecteurs semblables au CSS ; avec des classes utilitaires, comme on le ferait en Tailwind ; ou directement in-line, pour prendre la main de manière ponctuelle comme c&#039;est possible en HTML. Les breakpoints sont aussi gérés avec des media-queries, pour un rendu nativement responsive ;&lt;/li&gt;
&lt;li&gt;Beaucoup de Widgets sont disponibles nativement pour gérer la majorité des cas d’usages (ex: TextWidget pour affichage de texte et ASCII, InputWidget pour les entrées textuelles, SelectListWidget pour des listes scrollables, etc.) mais il est évidemment possible de créer nos propres widgets pour des cas particuliers ;&lt;/li&gt;
&lt;li&gt;TUI utilise PHP Fibers et Revolt pour assurer un affichage et des animations complètement asynchrones et une gestion parallèle de l’affichage et de l’interactivité avec le développeur.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;La liste s’allonge évidemment, et toutes les informations sont disponibles sur le &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://symfony.com/blog/introducing-the-symfony-tui-component&quot;&gt;Blog Post dédié à l’arrivée de Symfony TUI&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Pour conclure cette première conférence, Fabien s&#039;est montré particulièrement enthousiaste. Ce nouveau composant Symfony ouvre des portes immenses, aussi bien pour l&#039;affichage dans la console que pour l&#039;intégration de l&#039;intelligence artificielle.&lt;/p&gt;
&lt;p&gt;Pour prouver la puissance de son outil, il a même fait une démonstration impressionnante : un jeu de &lt;strong&gt;Tetris&lt;/strong&gt; tournant en direct dans son terminal ! Le rendu est fluide et visuellement bluffant, montrant que l&#039;on peut désormais créer de véritables interfaces graphiques (TUI) modernes, directement en PHP.&lt;/p&gt;
&lt;p&gt;Pour terminer, Fabien a lancé une idée très originale pour le futur des contributions sur ce composant : plutôt que d&#039;envoyer une solution toute prête, les développeurs pourraient simplement partager un &lt;strong&gt;prompt&lt;/strong&gt; (une instruction pour l&#039;IA).&lt;/p&gt;
&lt;p&gt;Fabien utiliserait alors son propre assistant et ses propres ressources pour transformer ces instructions en code réel et donner vie aux futures améliorations du projet !&lt;/p&gt;
&lt;h2&gt;La communauté au rythme de l’IA&lt;/h2&gt;
&lt;p&gt;On se souvient du &lt;strong&gt;SymfonyLive 2024&lt;/strong&gt;, où l’IA générative d&#039;images s&#039;invitait déjà dans de nombreuses présentations. À l&#039;époque, c’était encore une nouveauté impressionnante, bien que limitée.
Cette année, le changement est radical : les &lt;strong&gt;agents IA&lt;/strong&gt; étaient omniprésents dans bon nombre de sujets. Cela reflète parfaitement l&#039;évolution de notre quotidien de développeur, qui s&#039;accélère de plus en plus dans cette direction.&lt;/p&gt;
&lt;p&gt;Aujourd&#039;hui, l&#039;IA n&#039;est plus juste un gadget visuel, elle est au cœur du développement de Symfony :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Les nouvelles versions de &lt;strong&gt;Twig&lt;/strong&gt; (le moteur de templates de Symfony) sont désormais gérées de manière quasi automatique par un agent ;&lt;/li&gt;
&lt;li&gt;Une grande partie du code source est également générée par des assistants intelligents.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Cependant, un point reste essentiel : l&#039;IA aide à produire, mais elle ne remplace pas l&#039;humain. La &lt;strong&gt;responsabilité&lt;/strong&gt; finale appartient toujours à la personne qui valide le code. C&#039;est le développeur qui vérifie et garantit la qualité de ce qui est produit avant de l&#039;envoyer en production.&lt;/p&gt;
&lt;h3&gt;L’IA au service des devs : Anatomie d&#039;un assistant de Code Review - Thomas Boileau&lt;/h3&gt;
&lt;p&gt;La volonté de Thomas est de normaliser l’utilisation de l’IA au sein de sa société. Son constat est qu’il est difficile d’intervenir dans le cycle de développement logiciel, au niveau individuel, car l’usage de l’IA est encore très inégal selon les développeurs. C’est pour ça qu’il a préféré intervenir sur la CI.&lt;/p&gt;
&lt;p&gt;Lors de sa présentation, il nous expose donc un cas pratique. Son but : construire un assistant IA qui intervient au moment des code reviews.&lt;/p&gt;
&lt;p&gt;Techniquement, dès qu&#039;une PR est labellisé Ready For Review (RFR) alors un webhook est lancé, et l’assistant IA est déclenché.&lt;/p&gt;
&lt;p&gt;Ici, ce que l&#039;on apprend n’est pas réellement comment utiliser l’IA, mais plutôt un rappel bienvenu sur l’adoption d’une fonctionnalité par des utilisateurs. Il nous a bien expliqué qu’après sa première itération, quasiment personne n&#039;interagissait avec son agent de revue de code.&lt;/p&gt;
&lt;p&gt;En effet, comme toutes les nouveautés, l’essentiel, c&#039;est de construire avec les utilisateurs finaux et d’éviter au maximum la friction. C’est donc après avoir mesuré l’usage de son bot et consulté les développeurs (utilisateurs) qu’il a proposé une nouvelle version, cette fois-ci plus utile pour tout le monde.&lt;/p&gt;
&lt;p&gt;Évidement, Thomas nous rappelle qu’il aurait pu utiliser une solution sur étagère, mais il souligne les contraintes réglementaires qui s&#039;appliquent à son domaine.&lt;/p&gt;
&lt;p&gt;Sa conclusion est que le plus important dans ce projet reste la DX pour avoir une bonne adoption, et surtout que ce bot IA ne remplace pas l&#039;humain, il est créé dans le but d’être seulement un plus dans la boucle.&lt;/p&gt;
&lt;h3&gt;Développer un Coding Agent en PHP : dans les coulisses du &amp;quot;Harness&amp;quot; - Fabien Potencier&lt;/h3&gt;
&lt;p&gt;&lt;picture class=&quot;js-dialog-target&quot; data-original-url=&quot;/media/original/2026/symfony-live-paris-2026/fabien-potencies-ia-niveau.jpg&quot; data-original-width=&quot;1600&quot; data-original-height=&quot;738&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;/media/cache/content-webp/2026/symfony-live-paris-2026/fabien-potencies-ia-niveau.d189aa63.webp&quot; /&gt;&lt;source type=&quot;image/png&quot; srcset=&quot;/media/cache/content/2026/symfony-live-paris-2026/fabien-potencies-ia-niveau.jpg&quot; /&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; style=&quot;width: 996px; ; aspect-ratio: calc(1600 / 738)&quot; src=&quot;https://jolicode.com//media/cache/content/2026/symfony-live-paris-2026/fabien-potencies-ia-niveau.jpg&quot; alt=&quot;Les différents niveaux d&#039;utilisation de l&#039;IA selon Fabien&quot; /&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;Tout a commencé par un défi sur Twitter. Un utilisateur affirmait qu&#039;il était impossible de créer un &lt;strong&gt;coding agent&lt;/strong&gt; (un assistant capable de coder de façon autonome) performant en utilisant le langage PHP. Piqué au vif, Fabien Potencier, le créateur de Symfony, a décidé de prouver le contraire en développant son propre assistant.&lt;/p&gt;
&lt;p&gt;Plutôt que d&#039;utiliser des outils tout prêts comme GitHub Copilot ou Claude Code, fabriquer son propre agent permet de comprendre les coulisses de l’intelligence artificielle. On découvre alors comment se déroule réellement une &amp;quot;discussion&amp;quot; entre un développeur et un modèle de langage (LLM).&lt;/p&gt;
&lt;p&gt;Pour rendre l&#039;outil agréable à utiliser, il a utilisé le composant &lt;strong&gt;TUI de Symfony&lt;/strong&gt;. Cela permet d&#039;avoir une interface textuelle interactive directement dans sa console.&lt;/p&gt;
&lt;p&gt;Pour que l&#039;agent soit intelligent, il doit communiquer avec un modèle (comme Claude Opus, Claude Sonnet, GPT 5). Mais les modèles évoluent sans cesse. Fabien a donc créé un petit outil, &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://github.com/symfony/models-dev&quot;&gt;symfony/models-dev&lt;/a&gt;, qui répertorie de manière automatique tous les modèles disponibles afin de toujours utiliser la version la plus récente.&lt;/p&gt;
&lt;p&gt;Discuter avec un chat, c&#039;est facile. Mais pour qu&#039;un agent soit utile, il doit pouvoir agir sur votre ordinateur. C&#039;est là qu&#039;interviennent les &lt;em&gt;Tools&lt;/em&gt; (outils). De manière surprenante, Fabien n&#039;a eu besoin que de 4 outils de base :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Read&lt;/em&gt; : pour lire le contenu d&#039;un fichier.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Write&lt;/em&gt; : pour créer un nouveau fichier.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Update&lt;/em&gt; : pour modifier un fichier existant sans gaspiller de token.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Bash&lt;/em&gt; : pour exécuter n&#039;importe quelle commande (lancer des tests, installer un package, etc.).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Un agent classique oublie tout dès que la session se ferme. Pour corriger cela, chaque échange est enregistré dans une base de données.&lt;/p&gt;
&lt;p&gt;L’astuce géniale ? Cette mémoire est stockée sous forme d&#039;&lt;em&gt;arbre&lt;/em&gt;. Cela permet à l&#039;agent de revenir en arrière à un point précis pour tester une autre solution si la première n&#039;a pas fonctionné.&lt;/p&gt;
&lt;p&gt;Plus on discute avec l&#039;IA, plus le &amp;quot;contexte&amp;quot; (le nombre de mots envoyés) devient important. Si on dépasse la limite du modèle, il sature. Fabien a donc mis en place un système de compression intelligent :&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Il garde toujours le tout premier message (les instructions de base).&lt;/li&gt;
&lt;li&gt;Il garde les derniers messages récents.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Il résume&lt;/em&gt; tout ce qui se trouve entre les deux.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Les conseils de Fabien&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Durant sa démonstration, il a partagé quelques astuces précieuses :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Les Skills&lt;/em&gt; : Dès qu&#039;il réalise qu&#039;il répète une tâche, ou une instruction, il crée un &amp;quot;skill&amp;quot; (une compétence) pour son agent. C&#039;est comme écrire des tests : on a l&#039;impression de perdre du temps au début, mais on en gagne énormément sur le long terme ;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Le regard neuf&lt;/em&gt; : Parfois, l&#039;IA s&#039;embrouille. Fabien conseille de lui demander d&#039;analyser la situation avec &amp;quot;un regard neuf&amp;quot; (&lt;em&gt;fresh eyes&lt;/em&gt;). Cela donne souvent des résultats spectaculaires pour débloquer un bug complexe.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Bien qu&#039;il n&#039;ait pas eu le temps de tout montrer, notamment son système d&#039;orchestration dans le cloud, la preuve est faite : &lt;strong&gt;le PHP est un langage de choix pour l&#039;intelligence artificielle !&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Embeddings en PHP : Symfony AI en pratique - Grégoire Pineau&lt;/h3&gt;
&lt;p&gt;&lt;picture class=&quot;js-dialog-target&quot; data-original-url=&quot;/media/original/2026/symfony-live-paris-2026/gregoire-symfony-ai.jpg&quot; data-original-width=&quot;4080&quot; data-original-height=&quot;3072&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;/media/cache/content-webp/2026/symfony-live-paris-2026/gregoire-symfony-ai.c803838f.webp&quot; /&gt;&lt;source type=&quot;image/jpeg&quot; srcset=&quot;/media/cache/content/2026/symfony-live-paris-2026/gregoire-symfony-ai.jpg&quot; /&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; style=&quot;width: 996px; ; aspect-ratio: calc(4080 / 3072)&quot; src=&quot;https://jolicode.com//media/cache/content/2026/symfony-live-paris-2026/gregoire-symfony-ai.jpg&quot; alt=&quot;Grégoire lors de sa conférence sur Symfony AI&quot; /&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;Le talk de &lt;a href=&quot;https://jolicode.com/qui-sommes-nous/equipe/gregoire-pineau&quot;&gt;Grégoire&lt;/a&gt; nous met tout de suite dans la pratique avec une vraie mise en situation autour des embeddings et de la similarité de contenu.&lt;/p&gt;
&lt;p&gt;Il part sur un cas d’usage qui parle à tout le monde : faire correspondre des URLs entre un ancien et un nouveau site. Là où on pourrait partir sur des règles compliquées ou du matching approximatif, les embeddings offrent une solution plus robuste : on compare directement le sens sémantique des pages.&lt;/p&gt;
&lt;p&gt;Ce qui marche particulièrement bien, c’est le fil rouge visuel de la conférence. Un schéma du processus est affiché, puis réutilisé à chaque étape. Ce qui rend la progression assez claire : on comprend où on en est, ce qu’on fait, et pourquoi on le fait.&lt;/p&gt;
&lt;p&gt;La conférence prend le temps de poser les bases :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ce qu’est un embedding (une représentation vectorielle d’un contenu) ;&lt;/li&gt;
&lt;li&gt;à quoi ça sert (mesurer de la similarité sémantique) ;&lt;/li&gt;
&lt;li&gt;et surtout dans quels cas ça devient utile.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ensuite, on rentre dans le concret :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;comment choisir un modèle selon son besoin ;&lt;/li&gt;
&lt;li&gt;comment vectoriser ses données depuis Symfony ;&lt;/li&gt;
&lt;li&gt;où stocker ces vecteurs (PostgreSQL, Redis, etc.) ;&lt;/li&gt;
&lt;li&gt;et comment les requêter efficacement.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;L&#039;intérêt de cette présentation, c&#039;est que Grégoire nous a montré que tout se fait sans quitter l’écosystème Symfony, grâce à Symfony AI. Cette initiative fournit ainsi toutes les abstractions nécessaires pour manipuler modèles, stores, agents et bien plus encore. N&#039;hésitez pas à consulter le site dédié à &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://ai.symfony.com/&quot;&gt;Symfony AI&lt;/a&gt; pour découvrir tout ça.
&lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://speakerdeck.com/lyrixx/embeddings-symfony-ai-en-pratique&quot;&gt;Vous pouvez retrouver ses slides en ligne&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Retours d’expériences et présentations techniques&lt;/h2&gt;
&lt;p&gt;Tous ces nouveaux outils basés sur l&#039;IA ne doivent pas éclipser l&#039;importance de la technicité en dehors de l&#039;intelligence artificielle ! Au contraire, nous apprécions également les outils éprouvés et bien établis, et les retours d&#039;expériences de manière générale.&lt;/p&gt;
&lt;h3&gt;Chiffrez vos données avec Doctrine, en restant recherchable - Jérôme Tamarelle&lt;/h3&gt;
&lt;p&gt;Lors de cette conférence, Jérôme Tamarelle a rappelé un point essentiel : la sécurité des données ne concerne pas uniquement les informations directement identifiantes (comme un email ou un nom), mais aussi les données indirectes. Croisées entre elles, ces dernières peuvent suffire à identifier une personne.&lt;/p&gt;
&lt;p&gt;Il est important de distinguer deux approches souvent confondues :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Le chiffrement&lt;/em&gt; : les données sont transformées de manière réversible. On peut les déchiffrer à l’aide d’une clé ;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Le hashage&lt;/em&gt; : il s’agit d’une empreinte unique et fixe d’une donnée. Cette opération est irréversible.
Plusieurs types de chiffrement existent, dont le chiffrement aléatoire et le chiffrement déterministe.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Avec le &lt;em&gt;chiffrement aléatoire&lt;/em&gt;, chaque valeur est chiffrée différemment, même si elle est identique à une autre.
Par exemple, une même adresse email enregistrée deux fois en base produira deux valeurs chiffrées différentes.&lt;/p&gt;
&lt;p&gt;Avec le &lt;em&gt;chiffrement déterministe&lt;/em&gt;, une même donnée produira toujours le même résultat chiffré.&lt;/p&gt;
&lt;p&gt;Avec Doctrine, on encapsule le chiffrement directement dans Doctrine via des types personnalisés.
Un champ devient &amp;quot;chiffré&amp;quot; simplement par sa définition.&lt;/p&gt;
&lt;p&gt;Mais du coup, on ne peut plus faire de recherche sur ces champs sans passer par Doctrine.&lt;/p&gt;
&lt;p&gt;Sécuriser ses données, c’est accepter de complexifier son application. Et surtout, le faire dès la conception.&lt;/p&gt;
&lt;h3&gt;Doctrine inheritance - Rémi JANOT&lt;/h3&gt;
&lt;p&gt;Rémi commence par présenter la différence entre héritage (mapper une hiérarchie de classe) et polymorphisme (une clef étrangère qui pointe vers une autre classe) car le vocabulaire utilisé par les différents ORM et framework peuvent parfois prêter à confusion.&lt;/p&gt;
&lt;p&gt;S&#039;ensuit un rappel bienvenu de l’héritage implémenté directement au niveau de Doctrine ; avec des exemples concrets, il passe en revue toutes les combinaisons possibles : soit avec des MappedSuperClass, soit des DiscriminatorMap.&lt;/p&gt;
&lt;p&gt;Fort de son expérience, il nous explique aussi qu’il est possible d’assez facilement passer d’une architecture Single Table Inheritance (STI) vers Class Table Inheritance (CTI). Donc les choix techniques ne sont pas forcément figés, les projets évoluent, et des solutions sont toujours possibles. Il nous rappelle aussi que lorsqu’on utilise les CTI, il est important de bien vérifier les index pour gagner en performance.&lt;/p&gt;
&lt;h3&gt;JSON + SQL : hérésie ou élégance ? Retour d&#039;expérience - Rémy Bonfils, Olivier FOURNY&lt;/h3&gt;
&lt;p&gt;On reste ici dans le thème de la modélisation de nos bases de données avec un retour d’expérience sur l’utilisation de JSON dans nos tables SQL, via l’exemple d’une application mobile offline permettant de configurer des maisons imprimées en 3D (oui oui).&lt;/p&gt;
&lt;p&gt;Étant donné la nature très flexible des paramètres d’impression (80000 configurations possibles, importées depuis un CSV), la question de comment les stocker se pose dès le départ.
Rémy et Olivier nous expliquent vouloir tout d’abord se diriger vers une modélisation de type Entity-Attribute-Valeur, où les paramètres ne sont pas représentés par des colonnes dans nos tables, mais par des lignes (ça doit parler aux personnes devant travailler sur des projets Magento ou Drupal) : beaucoup de flexibilité évidemment, mais aussi l’impossibilité d’avoir un minimum de structure dans nos données (tout est varchar). Et surtout des requêtes beaucoup plus complexes et donc des performances catastrophiques.&lt;/p&gt;
&lt;p&gt;L’équipe se penche donc sur une autre solution : le stockage des paramètres dans des colonnes de la base de données en format JSON.&lt;/p&gt;
&lt;p&gt;Et la surprise, les performances sont à peine inférieures à une modélisation classique de base de données (avec des tables liées par des clés étrangères), mais en gardant la flexibilité voulue ! Et grâce aux fonctions SQL permettant de manipuler du JSON, les requêtes restent simples et lisibles.&lt;/p&gt;
&lt;p&gt;Pour notre part, à JoliCode, nous avons l’habitude de profiter du type JSON dans nos bases de données relationnelles (PostgreSQL ou MySQL), et nous vous le recommandons lorsque le besoin s’en fait ressentir.&lt;/p&gt;
&lt;h3&gt;ClickHouse pour les développeurs Symfony - Romain Neutron&lt;/h3&gt;
&lt;p&gt;&lt;picture class=&quot;js-dialog-target&quot; data-original-url=&quot;/media/original/2026/symfony-live-paris-2026/clickhouse-romain-neutron.jpg&quot; data-original-width=&quot;1600&quot; data-original-height=&quot;901&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;/media/cache/content-webp/2026/symfony-live-paris-2026/clickhouse-romain-neutron.6afbb7d4.webp&quot; /&gt;&lt;source type=&quot;image/jpeg&quot; srcset=&quot;/media/cache/content/2026/symfony-live-paris-2026/clickhouse-romain-neutron.jpg&quot; /&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; style=&quot;width: 996px; ; aspect-ratio: calc(1600 / 901)&quot; src=&quot;https://jolicode.com//media/cache/content/2026/symfony-live-paris-2026/clickhouse-romain-neutron.jpg&quot; alt=&quot;Romain Neutron lors de son talk sur ClickHouse&quot; /&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;Dans cette session, Romain Neutron a abordé la problématique de la gestion des données analytiques et des logs à grande échelle, des domaines où les bases relationnelles classiques comme MySQL ou PostgreSQL atteignent souvent leurs limites. Il a présenté &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://clickhouse.com/&quot;&gt;ClickHouse&lt;/a&gt;, une base de données orientée colonnes ultra-performante, comme la solution idéale pour traiter des volumes massifs de données en temps réel. L&#039;idée centrale n&#039;est pas de remplacer votre base de données habituelle, mais de l&#039;épauler pour des besoins spécifiques d&#039;agrégation et de dashboards instantanés.&lt;/p&gt;
&lt;p&gt;Côté technique, la conférence a mis en lumière la simplicité d&#039;intégration de ClickHouse dans l&#039;écosystème Symfony. Il a également partagé des benchmarks impressionnants comparant les temps de réponse sur des agrégations de plusieurs millions de lignes, montrant que ClickHouse peut transformer des requêtes de plusieurs secondes en résultats quasi instantanés.&lt;/p&gt;
&lt;p&gt;Enfin, Romain a insisté sur les bonnes pratiques et les pièges à éviter, notamment sur la structure des données et le choix des moteurs de table (comme MergeTree). C&#039;est un talk indispensable pour les développeurs cherchant à scaler leur stack analytique tout en restant dans un environnement PHP familier. De notre côté, on utilise ClickHouse dans plusieurs projets, surtout dans &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://redirection.io/&quot;&gt;redirection.io&lt;/a&gt; pour les parties logs, analytics et crawler. On ne peut donc que vous recommander de vous y intéresser.&lt;/p&gt;
&lt;p&gt;Ses slides sont &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://speakerdeck.com/romainneutron/clickhouse-for-symfony-developers-symfonylive-paris-2026&quot;&gt;disponibles en ligne&lt;/a&gt; pour retrouver toutes les informations importantes.&lt;/p&gt;
&lt;h2&gt;Symfony UX et la suite Hotwired&lt;/h2&gt;
&lt;p&gt;Cette année, on continue de parler de Symfony UX, et en particulier, deux retours d’expériences spécifiquement axés sur &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://hotwired.dev/&quot;&gt;hotwired.dev&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Du web au mobile avec Symfony &amp;amp; Hotwire Native - Imad ZAIRIG&lt;/h3&gt;
&lt;p&gt;Imad nous a préparé une conférence sur le nouveau bundle Symfony UX Native qui utilise Hotwire Native. Basé sur un exemple, on peut voir comment l’application est architecturée.&lt;/p&gt;
&lt;p&gt;On a eu l&#039;exemple d&#039;un bouton, rendu avec un composant bouton mobile, mais dont l&#039;événement click est écouté par stimulus du côté de l’application Symfony&lt;/p&gt;
&lt;p&gt;Cela fonctionne avec des webview pour que ce soit toujours Symfony qui gère le back-end et le front, mais avec des comportements mobiles gérés nativement (ex : la navigation et les transitions). On note qu’il y a quand même encore quelques fois ou il faut lancer le projet mobile avec Xcode par exemple pour iOS.&lt;/p&gt;
&lt;p&gt;Pour utiliser les capacités natives des applications mobiles (type appareil photo) il faut passer par des &amp;quot;Bridges Component&amp;quot;, ça demande malgré tout du code côté mobile.&lt;/p&gt;
&lt;p&gt;Selon la complexité de l’application et la taille de l’équipe, Symfony UX Native est une piste à explorer.&lt;/p&gt;
&lt;h3&gt;Édition simultanée : facile avec Symfony UX - David Buchmann&lt;/h3&gt;
&lt;p&gt;Au travers d’un exemple concret David nous a fait voir comment intégrer toute la suite d’outils de hotwired.dev. Il commence avec Turbo (et un peu de Turbo Frames aussi) et nous fait voir à quel point c’est bien intégré à Symfony UX. Puis sa conférence continue avec la mise en place de Mercure (grâce à son intégration dans FrankenPHP), et finalement le tout s’intègre parfaitement via des contrôleurs Stimulus qui écoutent les messages Mercure.&lt;/p&gt;
&lt;p&gt;Il résume les avantages de Hotwire comme ceci : la logique reste dans le backend, la sécurité est intégrée. La complexité du frontend s’en trouve réduite.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Si cette édition du SymfonyLive Paris 2026 nous a offert un aperçu saisissant de l&#039;intégration massive de l&#039;Intelligence Artificielle au cœur de l&#039;écosystème Symfony, elle prouve une chose essentielle : l&#039;importance des conférences n&#039;a jamais été aussi grande. Notre métier de développeur est en pleine mutation, et nous avons fort à faire pour rester à jour.&lt;/p&gt;
&lt;p&gt;Le fil conducteur de cette année reste cependant une évidence : quelle que soit la puissance des outils, &lt;strong&gt;l&#039;humain reste au centre de la boucle&lt;/strong&gt;. L&#039;IA est un assistant extraordinaire pour la production de code et les tâches répétitives, mais c&#039;est bien la communauté, la validation humaine et le partage de connaissances qui garantissent la qualité et la progression de notre écosystème.
Merci aux organisateurs, aux conférenciers, et à la communauté d&#039;avoir fait de cette édition 2026 un moment marquant, et rendez-vous l&#039;année prochaine pour continuer à naviguer ensemble dans le futur du développement web !&lt;/p&gt;

        </content>
    </entry>    <entry>
        <id>https://jolicode.com/blog/jane-now-supports-openapi-3-1-and-json-schema-2020-12</id>
        <published>2026-03-30T11:50:00+02:00</published>
        <updated>2026-03-30T11:50:00+02:00</updated>
        <link type="text/html" rel="alternate" href="https://jolicode.com/blog/jane-now-supports-openapi-3-1-and-json-schema-2020-12"/>
        <title>Jane now supports OpenAPI 3.1 and JSON Schema 2020-12</title>
        <author>
            <name>JoliCode Team</name>
            <uri>https://jolicode.com/</uri>
        </author>            <category term="symfony" />            <category term="jsonapi" />            <category term="jane" />            <category term="openapi" />        <summary><![CDATA[Version 7.11.0 of Jane PHP, the API client and Normalizer generator, is now available. This major update to the generation engine focuses on aligning with the latest industry standards through the support…]]></summary>
        <content type="html">
            &lt;p&gt;Version &lt;strong&gt;7.11.0&lt;/strong&gt; of Jane PHP, the API client and Normalizer generator, is now available. This major update to the generation engine focuses on aligning with the latest industry standards through the support of &lt;strong&gt;JSON Schema 2020-12&lt;/strong&gt; and &lt;strong&gt;OpenAPI 3.1&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;🚀 Major Updates&lt;/h2&gt;
&lt;h3&gt;JSON Schema 2020-12 Support&lt;/h3&gt;
&lt;p&gt;One of the most important changes introduced in this version is the integration of support for &lt;strong&gt;JSON Schema 2020-12&lt;/strong&gt; (PR &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://github.com/janephp/janephp/pull/918&quot;&gt;#918&lt;/a&gt;). This update allows Jane to process much more modern and complex data schemas, thus offering a richer semantics for describing your structures.&lt;/p&gt;
&lt;p&gt;It is important to note that this evolution was designed to be totally transparent: Jane retains &lt;strong&gt;backward compatibility with the 2019-09 draft&lt;/strong&gt;. You can therefore benefit from the latest advances without worrying about your existing schemas.&lt;/p&gt;
&lt;p&gt;This dual compatibility allows the tool to offer increased precision in two areas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;PHP model generation&lt;/strong&gt;: The generated classes more accurately reflect the constraints and relationships defined in your schemas, thus reducing the need for manual adjustments.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data validation&lt;/strong&gt;: The support of these specifications guarantees that the built-in validation logic is perfectly aligned with modern API requirements.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;OpenAPI 3.1 Support&lt;/h3&gt;
&lt;p&gt;The other pillar of this version is the support for the OpenAPI 3.1 specification (PR &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://github.com/janephp/janephp/pull/904&quot;&gt;#904&lt;/a&gt;). This update is structural because it finally aligns the OpenAPI standard with JSON Schema, thus simplifying the management of data models.&lt;/p&gt;
&lt;p&gt;Thanks to this support, Jane natively leverages the new capabilities of the standard:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Convergence with JSON Schema&lt;/strong&gt;: OpenAPI 3.1 becomes a &amp;quot;superset&amp;quot; of JSON Schema, allowing Jane to interpret complex definitions without loss of information.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Native and nullable typing&lt;/strong&gt;: Jane uses the new syntax to generate PHP properties with exact typing (e.g &lt;code&gt;?string&lt;/code&gt;), ensuring consistency between your API contract and your code.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;📖 New Official Documentation&lt;/h2&gt;
&lt;p&gt;Alongside these technical developments, the project&#039;s documentation has been refreshed to provide a better user experience. It centralizes the installation, configuration, and usage guides for all components.&lt;/p&gt;
&lt;p&gt;It is available here: &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://jane.jolicode.com/latest/&quot;&gt;https://jane.jolicode.com/latest/&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;🛠️ Continuous Improvements and Maintenance&lt;/h2&gt;
&lt;p&gt;Beyond these major developments, this version is also the occasion for a big spring cleaning for the project. We have consolidated the codebase with a series of stability fixes, particularly regarding the handling of numeric types in query strings, and an overall update of the maintenance tools. These adjustments, although more discreet, guarantee better reliability of the generator and simplify the installation of dependencies for your projects.&lt;/p&gt;
&lt;h2&gt;📦 Get Started!&lt;/h2&gt;
&lt;p&gt;All these improvements are available now via the &lt;strong&gt;v7.11.0&lt;/strong&gt; tag. Whether you want to take advantage of the latest OpenAPI specifications or simply benefit from a more robust generation engine, we strongly encourage you to update your projects:&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;composer&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; update&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; jane-php/&lt;/span&gt;&lt;span class=&quot;syntax-11&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; -W&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Feel free to test these new features, explore the new documentation, and give us your feedback on GitHub. Jane continues to grow thanks to your usage and contributions, so enjoy!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;📚 Official documentation: &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://jane.jolicode.com/latest/&quot;&gt;jane.jolicode.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;💻 GitHub Repository: &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://github.com/janephp/janephp&quot;&gt;janephp/janephp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;🚀 Release v7.11.0: &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://github.com/janephp/janephp/releases/tag/v7.11.0&quot;&gt;Check the changelog&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

        </content>
    </entry>    <entry>
        <id>https://jolicode.com/blog/jane-supporte-maintenant-json-schema-2020-12-et-openapi-3-1</id>
        <published>2026-03-30T11:34:00+02:00</published>
        <updated>2026-03-30T11:34:00+02:00</updated>
        <link type="text/html" rel="alternate" href="https://jolicode.com/blog/jane-supporte-maintenant-json-schema-2020-12-et-openapi-3-1"/>
        <title>Jane supporte maintenant JSON Schema 2020-12 et OpenAPI 3.1</title>
        <author>
            <name>JoliCode Team</name>
            <uri>https://jolicode.com/</uri>
        </author>            <category term="symfony" />            <category term="json" />            <category term="jsonapi" />            <category term="jane" />        <summary><![CDATA[La version v7.11.0 de Jane PHP, le générateur de client d&#039;API et de Normalizer, est désormais disponible. Cette mise à jour majeure du moteur de génération se concentre sur l&#039;alignement avec les derniers…]]></summary>
        <content type="html">
            &lt;p&gt;La version &lt;strong&gt;v7.11.0&lt;/strong&gt; de Jane PHP, le générateur de client d&#039;API et de Normalizer, est désormais disponible. Cette mise à jour majeure du moteur de génération se concentre sur l&#039;alignement avec les derniers standards de l&#039;industrie via le support de &lt;strong&gt;JSON Schema 2020-12&lt;/strong&gt; et d&#039;&lt;strong&gt;OpenAPI 3.1&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;🚀 Évolutions majeures&lt;/h2&gt;
&lt;h3&gt;Support de JSON Schema 2020-12&lt;/h3&gt;
&lt;p&gt;L&#039;un des changements les plus importants introduits dans cette version est l&#039;intégration du support pour &lt;strong&gt;JSON Schema 2020-12&lt;/strong&gt; (PR &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://github.com/janephp/janephp/pull/918&quot;&gt;#918&lt;/a&gt;). Cette mise à jour permet à Jane de traiter des schémas de données beaucoup plus modernes et complexes, offrant ainsi une sémantique plus riche pour la description de vos structures.&lt;/p&gt;
&lt;p&gt;Il est important de noter que cette évolution a été pensée pour être totalement transparente : Jane conserve une &lt;strong&gt;rétrocompatibilité avec la draft 2019-09&lt;/strong&gt;. Vous pouvez donc bénéficier des dernières avancées sans craindre pour vos schémas existants.&lt;/p&gt;
&lt;p&gt;Cette double compatibilité permet à l&#039;outil d&#039;offrir une précision accrue dans deux domaines :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;La génération des modèles PHP&lt;/strong&gt; : Les classes générées reflètent plus fidèlement les contraintes et relations définies dans vos schémas, réduisant ainsi le besoin d&#039;ajustements manuels.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;La validation des données&lt;/strong&gt; : Le support de ces spécifications garantit que la logique de validation intégrée est en parfaite adéquation avec les exigences modernes des API.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Support d&#039;OpenAPI 3.1&lt;/h3&gt;
&lt;p&gt;L&#039;autre pilier de cette version est le support de la spécification &lt;strong&gt;OpenAPI 3.1&lt;/strong&gt; (PR &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://github.com/janephp/janephp/pull/904&quot;&gt;#904&lt;/a&gt;). Cette mise à jour est structurante car elle aligne enfin le standard OpenAPI sur JSON Schema, simplifiant ainsi la gestion des modèles de données.&lt;/p&gt;
&lt;p&gt;Grâce à ce support, Jane exploite nativement les nouvelles capacités du standard :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Convergence avec JSON Schema&lt;/strong&gt; : OpenAPI 3.1 devient un &amp;quot;superset&amp;quot; de JSON Schema, permettant à Jane d&#039;interpréter des définitions complexes sans perte d&#039;information.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Typage natif et nullable&lt;/strong&gt; : Jane utilise la nouvelle syntaxe pour générer des propriétés PHP au typage exact (ex &lt;code&gt;?string&lt;/code&gt;), assurant une cohérence entre votre contrat d&#039;API et votre code.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;📖 Nouvelle documentation officielle&lt;/h2&gt;
&lt;p&gt;Parallèlement à ces évolutions techniques, la documentation du projet a reçu un coup de neuf pour offrir une meilleure expérience aux utilisateurs. Elle centralise les guides d&#039;installation, de configuration et d&#039;utilisation pour l&#039;ensemble des composants.&lt;/p&gt;
&lt;p&gt;Elle est disponible ici: &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://jane.jolicode.com/latest/&quot;&gt;jane.jolicode.com&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;🛠️ Améliorations continues et maintenance&lt;/h2&gt;
&lt;p&gt;Au-delà de ces évolutions majeures, cette version est aussi l&#039;occasion d&#039;un grand nettoyage de printemps pour le projet. Nous avons consolidé la base de code avec une série de correctifs de stabilité, notamment sur la gestion des types numériques dans les query strings, et une mise à jour globale des outils de maintenance. Ces ajustements, bien que plus discrets, garantissent une meilleure fiabilité du générateur et simplifient l&#039;installation des dépendances pour vos projets.&lt;/p&gt;
&lt;h2&gt;📦 Lancez-vous !&lt;/h2&gt;
&lt;p&gt;Toutes ces améliorations sont disponibles dès maintenant via le tag &lt;strong&gt;v7.11.0&lt;/strong&gt;. Que vous souhaitiez profiter des dernières spécifications OpenAPI ou simplement bénéficier d&#039;un moteur de génération plus robuste, nous vous encourageons vivement à mettre à jour vos projets :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;composer&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; update&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; jane-php/&lt;/span&gt;&lt;span class=&quot;syntax-11&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; -W&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;N&#039;hésitez pas à tester ces nouveautés, à explorer la nouvelle documentation et à nous faire part de vos retours sur GitHub. Jane continue de grandir grâce à vos usages et vos contributions, alors profitez-en bien !&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;📚 Documentation officielle : &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://jane.jolicode.com/latest/&quot;&gt;jane.jolicode.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;💻 Dépôt GitHub : &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://github.com/janephp/janephp&quot;&gt;janephp/janephp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;🚀 Release v7.11.0 : &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://github.com/janephp/janephp/releases/tag/v7.11.0&quot;&gt;Consulter le changelog&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

        </content>
    </entry>    <entry>
        <id>https://jolicode.com/blog/deploiement-on-premise-partie-2-castor-a-la-rescousse</id>
        <published>2026-03-26T10:41:00+01:00</published>
        <updated>2026-03-26T10:41:00+01:00</updated>
        <link type="text/html" rel="alternate" href="https://jolicode.com/blog/deploiement-on-premise-partie-2-castor-a-la-rescousse"/>
        <title>Déploiement On-Premise - Partie 2 - Castor à la rescousse</title>
        <author>
            <name>JoliCode Team</name>
            <uri>https://jolicode.com/</uri>
        </author>            <category term="devops" />            <category term="docker" />            <category term="castor" />        <summary><![CDATA[Dans le précédent article, nous avons vu toutes les étapes nécessaires pour préparer les images Docker qui seront utilisées en production. Mais nous allons maintenant aller plus loin pour automatiser…]]></summary>
        <content type="html">
            &lt;p&gt;Dans le &lt;a href=&quot;https://jolicode.com//blog/deploiement-on-premise-partie-1-le-socle-docker&quot;&gt;précédent article&lt;/a&gt;, nous avons vu toutes les étapes nécessaires pour préparer les images Docker qui seront utilisées en production. Mais nous allons maintenant aller plus loin pour automatiser et simplifier encore un peu plus cette étape grâce à Castor et les runners GitLab, le but étant de
faciliter la procédure de déploiement de nouvelles versions de l&#039;application afin que le client puisse
être autonome.&lt;/p&gt;
&lt;h2&gt;Création et publication des images&lt;/h2&gt;
&lt;p&gt;Comme souvent quand nos projets nécessitent de lancer des commandes, nous mettons en place des tâches Castor pour simplifier la DX. Nous avons donc créé une task &lt;code&gt;production:build&lt;/code&gt; qui applique tout ce que nous avons vu dans l&#039;article précédent :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;&amp;#x3C;?&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;php&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\Attribute\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;AsOption&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\Attribute\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;AsTask&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\Exception\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;ProblemException&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Symfony\Component\Console\Input\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;InputOption&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;capture&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;check&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;fs&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;variable&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; REGISTRY&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;&amp;#x3C;url du registre&gt;:4567/plancq/arsol/&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; DEFAULT_BRANCH&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;main&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; BAKE_FILE&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; __DIR__&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/../infrastructure/production/bake.hcl&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; IMAGES_TO_TAG&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;    &#039;postgres:16&#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; =&gt;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;postgres&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;    &#039;getmeili/meilisearch:v1.16&#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; =&gt;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;meilisearch&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;#[AsTask(description: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Build production docker images&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, namespace: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;production:docker&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; build&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    #[AsArgument(description: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Version of the images&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    ?string&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $tagVersion &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; null&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    #[AsOption(description: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Force the build whatever the current branch state&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    bool&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $force &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; false&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    #[AsOption(description: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Push the images to the registry&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, mode: &lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;InputOption&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;VALUE_NEGATABLE&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    ?bool&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $push &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; null&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    #[AsOption(description: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Update docker-compose.yml with current tag&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, mode: &lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;InputOption&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;VALUE_NEGATABLE&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    ?bool&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $updateDockerCompose &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; null&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; void&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    $currentBranch &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; capture&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;git&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;branch&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;--show-current&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    check&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Checking current branch:&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;You must be on the main branch to build the production images. Change the current branch or use --force to bypass this check.&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; fn&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; () =&gt; &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;DEFAULT_BRANCH&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; ===&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $currentBranch &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $force);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    $currentChanges &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; capture&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;git&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;status&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;--porcelain&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    check&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Checking git working tree:&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;You have uncommitted changes. Git stash everything before building image or use --force to bypass this check.&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; fn&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; () =&gt; &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;$currentChanges &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $force);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    if&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;$force) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;        run&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;git&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;pull&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;origin&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;DEFAULT_BRANCH&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    $validateVersion &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; static&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $tagVersion)&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; string&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        if&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;$tagVersion) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;            throw&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; new&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; \RuntimeException&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Version is required&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        if&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;preg_match&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;/&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;{2}&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;\.\d&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;{2}&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;\.\d&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;{2}&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;(-&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;)?&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;/&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, $tagVersion)) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;            throw&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; new&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; \RuntimeException&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Version must be in the format YYYY.MM.DD (eventually with a revision like YYYY.MM.DD-1), got: &#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $tagVersion);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        return&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $tagVersion;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    };&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    if&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; ($tagVersion) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        $tagVersion &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $validateVersion($tagVersion);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    } &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        $tagVersion &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;ask&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Please provide the version of the production images to build:&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;date&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Y.m.d&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;), $validateVersion);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    $tags &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; [$tagVersion, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;lastest&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;section&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Building the local development images...&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    \docker\&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    if&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;fs&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;exists&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;workingDirectory &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/.dockerignore&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;        fs&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;rename&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;workingDirectory &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/.dockerignore&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;workingDirectory &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/.dockerignore.tmp&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    try&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        $command &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;            &#039;docker&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;buildx&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;bake&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;            &#039;--file&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;BAKE_FILE&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;            &#039;--load&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        ];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        foreach&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;getImagesToBuild&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;() &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $targetName &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&gt;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $config) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;            foreach&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; ($tags &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $tag) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;                $command[] &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;--set&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;                $command[] &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $targetName &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;.tags+=&#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; REGISTRY&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $targetName &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;:&#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $tag;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;            }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;            $command[] &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;--set&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;            $command[] &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $targetName &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;.args.PROJECT_NAME=&#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; variable&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;project_name&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;        run&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;($command);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    } &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;finally&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        if&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;file_exists&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;workingDirectory &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/.dockerignore.tmp&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;            fs&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;rename&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;workingDirectory &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/.dockerignore.tmp&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;workingDirectory &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/.dockerignore&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    foreach&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;IMAGES_TO_TAG&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; as&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $sourceImage &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&gt;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $image) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        foreach&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; ($tags &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $tag) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;            run&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;docker&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;image&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;pull&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, $sourceImage]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;            run&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;docker&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;image&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;tag&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, $sourceImage, &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;REGISTRY&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $image &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;:&#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $tag]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;success&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Production images are now built.&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    if&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; ($updateDockerCompose &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; ===&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $updateDockerCompose &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;&amp;#x26;&amp;#x26;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;confirm&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Do you want to update the docker-compose with the current version?&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;))) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;        updateDockerCompose&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;($tagVersion);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    } &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;        io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;You can update the production docker-compose.yml file by running the following command:&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;        io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;castor production:docker:update-docker-compose &#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $tagVersion);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    if&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; ($push &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; ===&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $push &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;&amp;#x26;&amp;#x26;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;confirm&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Do you want to push the images to the registry (you may want to play with the images before pushing)?&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;))) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;        push&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;($tagVersion);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    } &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;        io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;You can push the images to the registry by running the following command:&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;        io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;castor production:docker:push&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;success&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Great job! Everything is now done.&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;#[AsTask(description: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Push production docker images&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, namespace: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;production:docker&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; push&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;?string&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $tag &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; null&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; void&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Pushing image to the registry...&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    foreach&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; ([&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;array_keys&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;getImagesToBuild&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()), &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;IMAGES_TO_TAG&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $image) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;        io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(\&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;sprintf&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Pushing %s image...&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, $image));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        if&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; ($tag) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;            run&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;docker&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;image&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;push&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;--disable-content-trust&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;REGISTRY&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $image &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;:&#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $tag]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        } &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;            run&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;docker&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;image&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;push&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;--disable-content-trust&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;--all-tags&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;REGISTRY&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $image]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;success&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(\&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;sprintf&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Production images have been pushed to the registry %s&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;REGISTRY&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; getImagesToBuild&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; array&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    $bakeConfigOutput &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; capture&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;([&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;        &#039;docker&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;buildx&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;bake&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;        &#039;--file&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;BAKE_FILE&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;        &#039;--print&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    ]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    $bakeConfig &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt; json_decode&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;($bakeConfigOutput, &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    if&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; ===&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $bakeConfig) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        throw&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; new&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; ProblemException&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Failed to parse bake.hcl output as JSON.&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    if&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;is_array&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;($bakeConfig) &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; !&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;isset&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;($bakeConfig[&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;target&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;]) &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; !&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;is_array&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;($bakeConfig[&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;target&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;])) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        throw&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; new&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; ProblemException&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Invalid bake.hcl structure or missing targets.&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    return&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $bakeConfig[&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;target&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;div class=&quot;c-alert c-alert--note&quot;&gt;
    &lt;p class=&quot;c-alert__title&quot;&gt;
                    &lt;span class=&quot;c-icon c-icon--monospace&quot;&gt;
                &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; aria-hidden=&quot;true&quot; class=&quot;c-icon__svg&quot; focusable=&quot;false&quot; viewBox=&quot;0 0 70 71&quot;&gt;&lt;path fill-rule=&quot;nonzero&quot; d=&quot;M35 .9c19.3 0 35 15.7 35 35s-15.7 35-35 35-35-15.7-35-35S15.7.9 35 .9m0 5c-16.552 0-30 13.449-30 30s13.448 30 30 30c16.552.103 30-13.448 30-30 0-16.551-13.448-30-30-30m0 24.9c1.7 0 3 1.3 3 3v15.3c0 1.7-1.3 3-3 3s-3-1.3-3-3V33.8c0-1.7 1.3-3 3-3m0-11c.8 0 1.6.3 2.3.9.6.5.9 1.3.9 2.1 0 .2-.1.4-.1.6-.1.2-.1.4-.2.6s-.2.3-.3.5-.3.4-.4.5c-1.1 1.1-3.1 1.1-4.2 0-.2-.2-.3-.3-.4-.5s-.2-.3-.3-.5-.2-.4-.2-.6c-.1-.2-.1-.4-.1-.6 0-.8.3-1.6.9-2.1.5-.6 1.3-.9 2.1-.9&quot;/&gt;&lt;/svg&gt;
            &lt;/span&gt;
                        &lt;strong&gt;Info&lt;/strong&gt;
    &lt;/p&gt;
    &lt;div class=&quot;c-alert__content&quot;&gt;
                &lt;p&gt;
Nous recommandons généralement de placer les tâches et fonctions du projets dans des fichiers .php dans le dossier &lt;code&gt;.castor/&lt;/code&gt; à la racine du dépôt.&lt;/p&gt;
        &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Pour résumer, cette task tout-en-un va :&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;s&#039;assurer que vous êtes sur la branche main, à jour et sans modification locale ;&lt;/li&gt;
&lt;li&gt;demander la version des tags à créer en prenant par défaut la date du jour ;&lt;/li&gt;
&lt;li&gt;construire la stack Docker de dev si nécessaire (pour avoir les images de base utilisées) ;&lt;/li&gt;
&lt;li&gt;exécuter la commande Bake pour construire/taguer les images PHP ;&lt;/li&gt;
&lt;li&gt;exécuter les commandes Docker pour construire/taguer les images publiques (Postgres et Meilisearch) ;&lt;/li&gt;
&lt;li&gt;demander si vous voulez mettre à jour la version des images dans le docker-compose.yml final (si jamais vous voulez tester l&#039;application en local avant de publier la version) ;&lt;/li&gt;
&lt;li&gt;demander si vous voulez publier les images sur le registry.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Chaque paramètre de cette task (la version à taguer, la confirmation de push ou de mise à jour du docker-compose.yml) est optionnel. S&#039;ils ne sont pas spécifiés, la task les demandera de manière intéractive.&lt;/p&gt;
&lt;p&gt;Il est maintenant très facile de publier une nouvelle version du projet pour n&#039;importe quel intervenant du projet (tant qu&#039;il a accès au registre Docker évidemment). Mais on peut aller encore un peu plus loin pour faciliter, cette fois, l&#039;exploitation de l&#039;infrastructure de production.&lt;/p&gt;
&lt;h2&gt;Pilotage de l&#039;infrastructure&lt;/h2&gt;
&lt;p&gt;Pour démarrer le projet (que ce soit en production, en pré-production ou sur du on-premise), nous avons besoin de 3 choses :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;créer le fichier docker-compose.yml avec tous les services définis ;&lt;/li&gt;
&lt;li&gt;créer un fichier .env pour configurer l&#039;application Symfony ;&lt;/li&gt;
&lt;li&gt;lancer la commande &lt;code&gt;docker compose up -d&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Nous allons tout d&#039;abord créer un nouvel ensemble de task Castor qui vont permettre de tout de piloter l&#039;infrastructure docker :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;&amp;#x3C;?&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;php&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;namespace&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;syntax-6&quot;&gt;production&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\Attribute\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;AsTask&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;Context&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\Event\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;BeforeExecuteTaskEvent&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\Exception\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;ProblemException&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Symfony\Component\Process\Exception\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;ProcessFailedException&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;fs&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;load_dot_env&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;wait_for_docker_container&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;#[AsTask(description: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Start production infrastructure&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; start&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; void&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    try&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;        production_docker_compose&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;up&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;-d&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    } &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;ProcessFailedException&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $e) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        if&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;preg_match&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;            &#039;/Bind for (.&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;):(?&amp;#x3C;port&gt;&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;) failed: port is already allocated/mi&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;            $e&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;getProcess&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;getErrorOutput&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;            $matches&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        )) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;            throw&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; new&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; ProblemException&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(\&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;sprintf&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;It seems that port %s is already used on your machine. Please free this port and try again.&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, $matches[&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;port&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;]), &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;previous&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: $e);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        throw&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $e;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;success&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Production infrastructure has been started. It should be available in a few seconds.&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    $url &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;https://&#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $_ENV[&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;SERVER_NAME&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    wait_for_docker_container&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;arsol-&#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $_ENV[&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;ARSOL_INSTANCE&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;-frontend-1&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, timeout: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;60&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, intervalMs: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;success&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(\&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;sprintf&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Production infrastructure is now ready at %s. Enjoy!&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, $url));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;#[AsTask(description: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Stop production infrastructure&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; stop&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; void&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Stopping production infrastructure&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    production_docker_compose&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;stop&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;success&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Production infrastructure has been stopped.&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; production_docker_compose&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $arguments)&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; void&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    load_dot_env&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;workingDirectory &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/.env&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    run&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;docker&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;compose&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;-f&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;docker-compose.yml&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;-p&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;arsol-&#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $_ENV[&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;ARSOL_INSTANCE&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;], &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;$arguments]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;div class=&quot;c-alert c-alert--note&quot;&gt;
    &lt;p class=&quot;c-alert__title&quot;&gt;
                    &lt;span class=&quot;c-icon c-icon--monospace&quot;&gt;
                &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; aria-hidden=&quot;true&quot; class=&quot;c-icon__svg&quot; focusable=&quot;false&quot; viewBox=&quot;0 0 70 71&quot;&gt;&lt;path fill-rule=&quot;nonzero&quot; d=&quot;M35 .9c19.3 0 35 15.7 35 35s-15.7 35-35 35-35-15.7-35-35S15.7.9 35 .9m0 5c-16.552 0-30 13.449-30 30s13.448 30 30 30c16.552.103 30-13.448 30-30 0-16.551-13.448-30-30-30m0 24.9c1.7 0 3 1.3 3 3v15.3c0 1.7-1.3 3-3 3s-3-1.3-3-3V33.8c0-1.7 1.3-3 3-3m0-11c.8 0 1.6.3 2.3.9.6.5.9 1.3.9 2.1 0 .2-.1.4-.1.6-.1.2-.1.4-.2.6s-.2.3-.3.5-.3.4-.4.5c-1.1 1.1-3.1 1.1-4.2 0-.2-.2-.3-.3-.4-.5s-.2-.3-.3-.5-.2-.4-.2-.6c-.1-.2-.1-.4-.1-.6 0-.8.3-1.6.9-2.1.5-.6 1.3-.9 2.1-.9&quot;/&gt;&lt;/svg&gt;
            &lt;/span&gt;
                        &lt;strong&gt;Info&lt;/strong&gt;
    &lt;/p&gt;
    &lt;div class=&quot;c-alert__content&quot;&gt;
                &lt;p&gt;
Cette fois, nous plaçons les tasks et fonctions destinées à être utilisées en production dans un dossier &lt;code&gt;tools/production/castor.php&lt;/code&gt;. Nous expliquerons l&#039;intérêt de séparer ces tasks dans un dossier à part dans le chapitre suivant.&lt;/p&gt;
        &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Avec ces deux tasks, on peut maintenant lancer &lt;code&gt;castor production:start&lt;/code&gt; et &lt;code&gt;castor production:stop&lt;/code&gt;. Mais pour une meilleure DX, on va également créer automatiquement le fichier &lt;code&gt;.env&lt;/code&gt; de base ainsi que le fichier &lt;code&gt;docker-compose.yml&lt;/code&gt; s&#039;ils n&#039;existent pas encore. Cela se fait facilement avec le système de &lt;em&gt;Listener&lt;/em&gt; intégré dans Castor :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\Attribute\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;AsListener&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\Event\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;BeforeExecuteTaskEvent&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;fs&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; Castor\&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; DOT_ENV_GENERABLES&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;    &#039;APP_SECRET&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;    &#039;POSTGRES_PASSWORD&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;    &#039;MEILI_MASTER_KEY&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;#[AsListener(&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;BeforeExecuteTaskEvent&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;::class&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; configure&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;BeforeExecuteTaskEvent&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $event)&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; void&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    $context &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; context&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    $taskName &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;) $event&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;task&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;getName&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    if&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;str_starts_with&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;($taskName, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;production:&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        ||&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; str_starts_with&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;($taskName, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;production:docker:&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        ||&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;production:repack&#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; ===&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $taskName) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        return&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    if&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;fs&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;exists&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;($context&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;workingDirectory &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/docker-compose.yml&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;        io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;No docker-compose.yml file found in the current directory. Creating one from the default template.&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;        fs&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;copy&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;__DIR__&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/docker-compose.yml&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, $context&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;workingDirectory &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/docker-compose.yml&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    if&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;fs&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;exists&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;($context&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;workingDirectory &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/.env&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;        io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;No .env file found in the current directory. Creating one from the default template.&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;        fs&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;copy&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;__DIR__&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/.env.production&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, $context&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;workingDirectory &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/.env&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    foreach&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;DOT_ENV_GENERABLES&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; as&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $envVar) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        $dotEnvContent &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt; file_get_contents&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;($context&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;workingDirectory &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/.env&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        if&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt;preg_match&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;/^&#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt; preg_quote&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;($envVar, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;/&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;=.+$/m&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, $dotEnvContent)) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;            continue&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        $value &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt; bin2hex&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;random_bytes&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        $dotEnvContent &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt; preg_replace&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;/^&#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt; preg_quote&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;($envVar, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;/&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;=.*/m&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, $envVar &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;=&#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $value, $dotEnvContent);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-9&quot;&gt;        file_put_contents&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;($context&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;workingDirectory &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/.env&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, $dotEnvContent);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Nous avons également ajouté quelques tasks supplémentaires pour afficher les logs du projet Docker compose, pour afficher l&#039;état des conteneurs ou encore pour détruire complètement toute trace du projet (pratique quand on veut juste tester la stack).&lt;/p&gt;
&lt;h2&gt;Création d&#039;un exécutable&lt;/h2&gt;
&lt;p&gt;Castor propose une &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://castor.jolicode.com/docs/going-further/extending-castor/repack/&quot;&gt;fonctionnalité de repack&lt;/a&gt; qui permet de packager un projet Castor avec ses tasks dans un Phar autonome, ce qui permet de le partager et l&#039;utiliser sans avoir besoin d&#039;avoir le code du projet, ni même d&#039;avoir Castor installé. C&#039;est parfait pour notre environnement de production / On-Premise car hormis PHP, nous avons rien à installer à l&#039;avance pour pouvoir démarrer l&#039;application.&lt;/p&gt;
&lt;p&gt;Dans le dossier &lt;code&gt;tools/production/&lt;/code&gt;, nous allons donc placer plusieurs fichiers qui seront inclus dans le phar :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;un fichier .env.production avec les vars d&#039;env à définir obligatoirement ;&lt;/li&gt;
&lt;li&gt;le fichier docker-compose.yml vu dans le précédent article ;&lt;/li&gt;
&lt;li&gt;le fichier castor.php du chapitre précédent qui contient les tasks pour piloter la stack.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Nous allons donc maintenant pouvoir repacker le projet Castor situé dans ce dossier &lt;code&gt;tools/production/&lt;/code&gt;. La commande à lancer en dev pour repacker notre projet sera évidemment encapsulée dans une task Castor (donc placée dans le dossier habituel &lt;code&gt;.castor/&lt;/code&gt;) :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; PRODUCTION_DIRECTORY&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; __DIR__&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/../tools/production/&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;#[AsTask(description: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Repack production application in a new phar&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; repack&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; void&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    io&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Repacking production application.&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;    // Castorception \o/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    run&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;castor repack --app-name=arsol --no-logo&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, context: &lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;withWorkingDirectory&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;PRODUCTION_DIRECTORY&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    fs&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;mkdir&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;PRODUCTION_DIRECTORY&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/build&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    fs&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;remove&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;finder&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;PRODUCTION_DIRECTORY&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/build&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;ignoreDotFiles&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;    fs&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;rename&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;PRODUCTION_DIRECTORY&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/arsol.linux.phar&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;PRODUCTION_DIRECTORY&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;/build/arsol.phar&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Il ne reste qu&#039;à installer le fichier &lt;code&gt;tools/production/build/arsol.phar&lt;/code&gt; sur le serveur, par exemple dans &lt;code&gt;/usr/bin/local/arsol&lt;/code&gt;. On peut dès maintenant lancer la commande &lt;code&gt;arsol production:start&lt;/code&gt; (notez le nom de l&#039;exécutable 😎) pour initialiser et démarrer complètement l&#039;infrastructure.&lt;/p&gt;

&lt;div class=&quot;c-alert c-alert--note&quot;&gt;
    &lt;p class=&quot;c-alert__title&quot;&gt;
                    &lt;span class=&quot;c-icon c-icon--monospace&quot;&gt;
                &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; aria-hidden=&quot;true&quot; class=&quot;c-icon__svg&quot; focusable=&quot;false&quot; viewBox=&quot;0 0 70 71&quot;&gt;&lt;path fill-rule=&quot;nonzero&quot; d=&quot;M35 .9c19.3 0 35 15.7 35 35s-15.7 35-35 35-35-15.7-35-35S15.7.9 35 .9m0 5c-16.552 0-30 13.449-30 30s13.448 30 30 30c16.552.103 30-13.448 30-30 0-16.551-13.448-30-30-30m0 24.9c1.7 0 3 1.3 3 3v15.3c0 1.7-1.3 3-3 3s-3-1.3-3-3V33.8c0-1.7 1.3-3 3-3m0-11c.8 0 1.6.3 2.3.9.6.5.9 1.3.9 2.1 0 .2-.1.4-.1.6-.1.2-.1.4-.2.6s-.2.3-.3.5-.3.4-.4.5c-1.1 1.1-3.1 1.1-4.2 0-.2-.2-.3-.3-.4-.5s-.2-.3-.3-.5-.2-.4-.2-.6c-.1-.2-.1-.4-.1-.6 0-.8.3-1.6.9-2.1.5-.6 1.3-.9 2.1-.9&quot;/&gt;&lt;/svg&gt;
            &lt;/span&gt;
                        &lt;strong&gt;Info&lt;/strong&gt;
    &lt;/p&gt;
    &lt;div class=&quot;c-alert__content&quot;&gt;
                &lt;p&gt;
Si nous le voulions, nous pourrions également compiler ce phar dans un binaire statique contenant PHP, ce qui aurait éliminé le besoin d&#039;avoir PHP installé sur le serveur pour pouvoir utiliser le projet repacké. N&#039;hésitez pas à jeter un œil à la &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://castor.jolicode.com/docs/going-further/extending-castor/compile/&quot;&gt;documentation Castor qui explique comment compiler son projet&lt;/a&gt;.&lt;/p&gt;
        &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;picture class=&quot;js-dialog-target&quot; data-original-url=&quot;/media/original/2026/on-premise-docker-castor/arsol-production-phar.png&quot; data-original-width=&quot;1242&quot; data-original-height=&quot;559&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;/media/cache/content-webp/2026/on-premise-docker-castor/arsol-production-phar.d2bfb0f1.webp&quot; /&gt;&lt;source type=&quot;image/png&quot; srcset=&quot;/media/cache/content/2026/on-premise-docker-castor/arsol-production-phar.png&quot; /&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; style=&quot;width: 996px; ; aspect-ratio: calc(1242 / 559)&quot; src=&quot;https://jolicode.com//media/cache/content/2026/on-premise-docker-castor/arsol-production-phar.png&quot; alt=&quot;Les tasks disponibles dans l&#039;exécutable arsol&quot; /&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;h2&gt;Automatiser le build depuis Gitlab&lt;/h2&gt;
&lt;p&gt;Dernière étape pour simplifier la vie du client, nous allons automatiser plusieurs choses directement depuis Gitlab :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Le build des images Docker de prod et le push sur le registre Docker ;&lt;/li&gt;
&lt;li&gt;Le repack du projet tools/production dans un phar autonome ;&lt;/li&gt;
&lt;li&gt;Ajout de ce phar dans les artefacts associés du job pour le rendre facilement accessible.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Voici un extrait du fichier &lt;code&gt;.gitlab-ci.yml&lt;/code&gt; qui permet de faire cela :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;stages&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;  # ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;release&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;variables&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  CASTOR_CONTEXT&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;ci&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  CASTOR_WORKING_DIR&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;/tmp/castor/${CI_PIPELINE_ID}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;# ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;release&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  stage&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;release&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  script&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;export TAG=$(date +%Y.%m.%d)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;export RELEASE_DIRECTORY=/tmp/castor-release/${TAG}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;rm -rf ${RELEASE_DIRECTORY}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;git clone . ${RELEASE_DIRECTORY}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;cd $RELEASE_DIRECTORY&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;echo &quot;$CI_REGISTRY_PASSWORD&quot; | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;castor production:docker:build --push --update-docker-compose &quot;$TAG&quot; --force&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;castor production:repack&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;    # On déplace le phar à la racine, pour qu&#039;il soit exposé en tant qu&#039;artefact du job&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;cp tools/production/build/arsol.phar &quot;$CI_PROJECT_DIR/&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;    # On est sur un self-hosted runner donc on fait le ménage avant de terminer&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;castor docker:destroy --force&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;rm -rf $RELEASE_DIRECTORY&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;  # Cet artefact sera associé au job, et donc facilement récupérable depuis GitLab&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  artifacts&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    paths&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;      - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;arsol.phar&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    expire_in&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;1 week&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;  # Ce job est à lancer manuellement et n&#039;est disponible que sur la branche main&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  when&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;manual&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  allow_failure&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;true&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  rules&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    - &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;$CI_COMMIT_BRANCH == &quot;main&quot;&#039;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;      when&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;manual&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    - &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;when&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;never&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Avant de finir cet article, je voudrais revenir sur un point vu précédemment. Vous vous souvenez de la variable &lt;code&gt;PROJECT_NAME&lt;/code&gt; qui était employée pour préfixer le nom de l&#039;image de la stack de dev ? C&#039;était nécessaire justement quand la stack de prod est construite dans la CI GitLab.&lt;/p&gt;
&lt;p&gt;En effet, comme nous utilisons un runner self-hosté, les jobs ne sont pas isolés et tournent sur la même machine en parallèle. Pour ne pas avoir de conflits dans les noms et avoir une stack Docker indépendante entre chaque build de la CI, nous avons donc besoin que les projets Docker compose utilisent un nom unique pour chaque build. Notre template docker-starter est parfaitement compatible avec ce use-case et expose une variable dans le contexte qui permet d&#039;adapter le nom du projet Docker compose à notre guise :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;// castor.php à la racine du projet&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; create_default_variables&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; array&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    return&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;        // Nom du projet docker compose par défaut en local&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;        &#039;project_name&#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; =&gt;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;arsol&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;        // ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    ];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;// .castor/context.php&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;#[AsContext(name: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;ci&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; create_ci_context&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; Context&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    $pipelineId &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $_SERVER[&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;CI_PIPELINE_ID&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;??&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; throw&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; new&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; \RuntimeException&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;CI_PIPELINE_ID is not set. This context should only be used in a CI environment.&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    $c &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; create_test_context&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    return&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $c&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        -&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;withData&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;([&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;            &#039;project_name&#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; =&gt;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &#039;arsol-ci-&#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $pipelineId,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;            &#039;docker_compose_files&#039;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; =&gt;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;                &#039;docker-compose.yml&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;                &#039;docker-compose.ci.yml&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;            ],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        ], recursive: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    ;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Comme nous forçons le context &lt;code&gt;CASTOR_CONTEXT=ci&lt;/code&gt; dans GitLab, toutes les stacks construites dans cet environnement sont automatiquement nommées avec un suffixe qui reprend l&#039;id de la pipeline actuelle.&lt;/p&gt;
&lt;p&gt;Au passage, on rajoute un &lt;code&gt;docker-compose.ci.yml&lt;/code&gt; au projet qui va rajouter quelques configurations spécifiques à la CI (comme des variables d&#039;environnement ou un routeur adaptés)&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Pour conclure, grâce au template docker-starter et à Castor, nous avons pu mettre en place un déploiement d&#039;&lt;em&gt;ArSol&lt;/em&gt; qui convient à la fois pour la production et le On-Premise mais qui reste simple à l&#039;usage :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Les images Docker pré-construites garantissent des déploiements fiables et déterministes ;&lt;/li&gt;
&lt;li&gt;Les images sont optimisées pour ne contenir que ce qui est nécessaire, sans les outils de build ;&lt;/li&gt;
&lt;li&gt;Tout passe par Castor, la complexité Docker/CI est masquée ;&lt;/li&gt;
&lt;li&gt;Le &lt;em&gt;repack&lt;/em&gt; Castor génère un seul exécutable (&lt;code&gt;arsol.phar&lt;/code&gt;) pour tout gérer (démarrer, arrêter, mettre à jour) sur site, même sans être un expert système.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;L&#039;automatisation complète via Castor et GitLab CI permet au client d&#039;être autonome pour préparer et déployer une mise à jour pour tous les environnements. Une preuve que Docker et Castor sont la bonne formule pour transformer des contraintes de terrain en solutions d&#039;infrastructure efficaces et élégantes.&lt;/p&gt;

        </content>
    </entry>    <entry>
        <id>https://jolicode.com/blog/deploiement-on-premise-partie-1-le-socle-docker</id>
        <published>2026-03-25T10:41:00+01:00</published>
        <updated>2026-03-25T10:41:00+01:00</updated>
        <link type="text/html" rel="alternate" href="https://jolicode.com/blog/deploiement-on-premise-partie-1-le-socle-docker"/>
        <title>Déploiement On-Premise - Partie 1 - Le socle Docker</title>
        <author>
            <name>JoliCode Team</name>
            <uri>https://jolicode.com/</uri>
        </author>            <category term="devops" />            <category term="docker" />            <category term="castor" />        <summary><![CDATA[Dans cet article, nous vous expliquons notre approche de déploiement hybride pour une application Symfony conteneurisée avec Docker. Ce système permet un déploiement à la fois sur des serveurs connectés…]]></summary>
        <content type="html">
            &lt;p&gt;Dans cet article, nous vous expliquons notre approche de déploiement hybride pour une application Symfony conteneurisée avec Docker. Ce système permet un déploiement à la fois sur des serveurs connectés à Internet et en mode local (on-premise) pour les zones de travail sans connectivité réseau.&lt;/p&gt;
&lt;h2&gt;Le contexte&lt;/h2&gt;
&lt;p&gt;Nous avons récemment entrepris la refonte complète de l&#039;application &lt;em&gt;ArSol&lt;/em&gt; pour l&#039;équipe archéologique de l&#039;université de Tours. Le logiciel original, une application desktop, était obsolète. Nous l&#039;avons entièrement modernisé en développant une application web sur mesure... avec une interface utilisateur considérablement rajeunie de plusieurs décennies propulsée avec Symfony 7.4, PHP 8.4 et FrankenPHP.&lt;/p&gt;
&lt;p&gt;Une des particularités du projet, c&#039;est que l&#039;application peut être utilisée sur des lieux de fouilles archéologiques ne disposant pas de réseau. Pour plusieurs raisons, l&#039;idée d&#039;une &lt;abbr title=&quot;Progressive Web App&quot;&gt;PWA&lt;/abbr&gt; a été écartée assez rapidement. Nous avons plutôt opté pour un mode de déploiement On-Premise : chaque site de fouille pourra ainsi faire tourner l&#039;infrastructure complète (serveur web, bases de données et application Symfony) sur une machine locale. Les contraintes métiers nous ont permis de développer, sans trop de complexité, un système de verrouillage partiel de l&#039;application (pour éviter tout conflit) et une synchronisation des données entre le &lt;abbr title=&quot;Software as a Service&quot;&gt;SaaS&lt;/abbr&gt; (c&#039;est-à-dire la production, le serveur central) et les instances On-Premise.&lt;/p&gt;
&lt;p&gt;&lt;picture&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;/media/cache/content-webp/2026/on-premise-docker-castor/arsol-schema-onpremise.b3de4a68.webp&quot; /&gt;&lt;source type=&quot;image/png&quot; srcset=&quot;/media/cache/content/2026/on-premise-docker-castor/arsol-schema-onpremise.png&quot; /&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; style=&quot;width: 777px; ; aspect-ratio: calc(777 / 757)&quot; src=&quot;https://jolicode.com//media/cache/content/2026/on-premise-docker-castor/arsol-schema-onpremise.png&quot; alt=&quot;Le schéma des différentes instances&quot; /&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;Je vais vous montrer aujourd&#039;hui comment nous avons mis en place ce déploiement On-Premise (que j&#039;abrégerai &lt;abbr title=&quot;On-Premise&quot;&gt;OP&lt;/abbr&gt; dans la suite de cet article). D&#039;abord, nous verrons comment se présente la stack Docker, puis comment nous avons automatisé la création des images et le déploiement.&lt;/p&gt;
&lt;h2&gt;La base Docker&lt;/h2&gt;
&lt;p&gt;Pour ce projet, nous avons choisi de déployer l&#039;application via des images Docker, aussi bien pour la production que pour les instances OP. Ainsi, ce sont les mêmes images Docker qui seront utilisées dans le mode SaaS et dans le mode OP. L’activation des différentes options et feature flags repose exclusivement sur des variables d’environnement.&lt;/p&gt;
&lt;h3&gt;La stack de dev&lt;/h3&gt;
&lt;p&gt;Sur tous nos projets, nous utilisons &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://github.com/jolicode/docker-starter&quot;&gt;docker-starter&lt;/a&gt; et &lt;em&gt;ArSol&lt;/em&gt; n&#039;y a pas fait exception. Ce squelette fournit une stack Docker complète, avec tout ce qu&#039;il faut dedans pour que chaque intervenant du projet puisse le faire tourner en local facilement.&lt;/p&gt;
&lt;p&gt;Docker-starter s&#039;est amélioré au fil des années pour offrir une excellente &lt;abbr title=&quot;Developer eXperience&quot;&gt;DX&lt;/abbr&gt; à tous nos développeurs, qu&#039;ils soient développeurs PHP ou intégrateurs, qu&#039;ils soient à l&#039;aise avec le fonctionnement de Docker ou pas du tout.&lt;/p&gt;
&lt;p&gt;Pour cela, toute la stack est pilotée par des tasks Castor 🦫 :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;castor start&lt;/code&gt; : construit les images si nécessaire, les démarre, installe les dépendances Composer/Yarn/npm, build les assets front, etc. Bref, cette seule commande suffit pour rendre le projet complètement fonctionnel en local, que ce soit au premier lancement ou aux lancements suivants ;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;castor migrate&lt;/code&gt; : joue les migrations Doctrine ;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;castor stop&lt;/code&gt; : stoppe toute la stack ;&lt;/li&gt;
&lt;li&gt;et plein d&#039;autres tasks pour les power users ou pour ceux qui veulent lancer une tâche particulière, par exemple ré-installer les dépendances, exécuter les tests, etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Cette infrastructure dockerisée est parfaite pour le développement&lt;/strong&gt; :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Les tâches castor fournies couvrent une bonne partie des besoins du quotidien ;&lt;/li&gt;
&lt;li&gt;Le code du projet n&#039;est pas copié/collé dans les conteneurs, mais &amp;quot;monté&amp;quot; dans des volumes pour chaque conteneur. Ainsi, les modifications dans le code sont directement disponibles dans les conteneurs, pas de build/restart à faire à chaque modification.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Comment passer en production ?&lt;/h3&gt;
&lt;p&gt;Si Docker-starter est parfait pour l&#039;environnement de développement, il ne doit toutefois pas être utilisé tel quel en production.&lt;/p&gt;
&lt;p&gt;En production, la priorité est la fiabilité, la sécurité, la rapidité de déploiement et la reproductibilité de l&#039;environnement. Contrairement à l&#039;environnement de développement où le montage de volume permet l&#039;itération rapide du code, en production, on cherche à minimiser les étapes au moment du déploiement.&lt;/p&gt;
&lt;p&gt;Avoir des images pré-construites garantit que l&#039;image qui a été testée et validée contient exactement le code, les dépendances (Composer, Yarn/npm) et les assets frontend nécessaires et compilées. Cela élimine le besoin d&#039;exécuter des commandes de &lt;em&gt;build&lt;/em&gt; ou d&#039;installation au moment du lancement des conteneurs (sur les serveurs de production ou sur les instances On-Premise). Cela réduit ainsi le risque d&#039;erreurs dues à des dépendances externes ou des configurations de l&#039;environnement hôte. C&#039;est la garantie d&#039;un déploiement &amp;quot;figé&amp;quot; et déterministe.
D&#039;ailleurs, comme les assets sont buildées en amont, nous n&#039;avons pas besoin de NodeJS dans le conteneur final, ce qui permet également d&#039;avoir des images plus légères in-fine.&lt;/p&gt;
&lt;p&gt;L&#039;objectif est d&#039;avoir des images Docker prêtes pour la production, mais aussi utilisables pour la pré-production et le déploiement on-premise.&lt;/p&gt;
&lt;h3&gt;L&#039;important, c&#039;est la santé&lt;/h3&gt;
&lt;p&gt;Dans l&#039;idéal, nous souhaitons également que chaque service définisse son propre &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://docs.docker.com/reference/dockerfile/#healthcheck&quot;&gt;healthcheck&lt;/a&gt;. Un healthcheck est une commande que Docker pourra exécuter pour déterminer si le conteneur est toujours en bon état. Si ce n&#039;est pas le cas, Docker tentera de redémarrer le conteneur. Voilà un exemple de healthcheck permettant de vérifier si un serveur MySQL est toujours opérationnel dans un conteneur :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;mysqladmin&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; ping&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; -h&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; localhost&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Il se configure de cette manière dans un docker-compose.yml classique:&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;services&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  mysql&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    image&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;mysql&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    restart&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;unless-stopped&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    healthcheck&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;      test&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: [&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;CMD&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;mysqladmin&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; ,&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;ping&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;-h&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;localhost&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;      timeout&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;20s&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;      retries&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;10&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;En général, je préfère que les images &amp;quot;applicatives&amp;quot; déclarent elles-mêmes leur healthcheck plutôt que de laisser l&#039;utilisateur le définir lui-même dans son docker-compose.yml. Cela offre, selon moi, deux avantages :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;l&#039;image garde la responsabilité de tout configurer comme il faut : l&#039;utilisateur n&#039;a pas besoin de savoir ce qui tourne dans l&#039;image, comment vérifier que tout fonctionne (faut-il utiliser wget, curl ou un autre outil pour avoir l&#039;état du service), etc ;&lt;/li&gt;
&lt;li&gt;le docker-compose.yml reste le plus simple possible pour l&#039;utilisateur.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Cela se fait grâce à l&#039;instruction &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://docs.docker.com/reference/dockerfile/#healthcheck&quot;&gt;&lt;code&gt;HEALTHCHECK&lt;/code&gt;&lt;/a&gt; directement dans le dockerfile de l&#039;image en question. Voici un exemple d&#039;un healthcheck qu&#039;on pourrait définir dans le Dockerfile pour un conteneur faisant tourner un serveur web :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;HEALTHCHECK --interval=5m --timeout=3s CMD curl -f http://localhost/ || exit 1
&lt;/code&gt;&lt;/pre&gt;

&lt;div class=&quot;c-alert c-alert--note&quot;&gt;
    &lt;p class=&quot;c-alert__title&quot;&gt;
                    &lt;span class=&quot;c-icon c-icon--monospace&quot;&gt;
                &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; aria-hidden=&quot;true&quot; class=&quot;c-icon__svg&quot; focusable=&quot;false&quot; viewBox=&quot;0 0 70 71&quot;&gt;&lt;path fill-rule=&quot;nonzero&quot; d=&quot;M35 .9c19.3 0 35 15.7 35 35s-15.7 35-35 35-35-15.7-35-35S15.7.9 35 .9m0 5c-16.552 0-30 13.449-30 30s13.448 30 30 30c16.552.103 30-13.448 30-30 0-16.551-13.448-30-30-30m0 24.9c1.7 0 3 1.3 3 3v15.3c0 1.7-1.3 3-3 3s-3-1.3-3-3V33.8c0-1.7 1.3-3 3-3m0-11c.8 0 1.6.3 2.3.9.6.5.9 1.3.9 2.1 0 .2-.1.4-.1.6-.1.2-.1.4-.2.6s-.2.3-.3.5-.3.4-.4.5c-1.1 1.1-3.1 1.1-4.2 0-.2-.2-.3-.3-.4-.5s-.2-.3-.3-.5-.2-.4-.2-.6c-.1-.2-.1-.4-.1-.6 0-.8.3-1.6.9-2.1.5-.6 1.3-.9 2.1-.9&quot;/&gt;&lt;/svg&gt;
            &lt;/span&gt;
                        &lt;strong&gt;Info&lt;/strong&gt;
    &lt;/p&gt;
    &lt;div class=&quot;c-alert__content&quot;&gt;
                &lt;p&gt;
Certaines images publiques ne fournissent volontairement pas de healthcheck. Il faudra donc le configurer nous-même, soit dans une image à vous, soit dans le docker-compose.yml.&lt;/p&gt;
        &lt;/div&gt;
&lt;/div&gt;

&lt;h3&gt;Publication et utilisation des images finales&lt;/h3&gt;
&lt;p&gt;Une fois les images construites, il faut les publier sur un registre Docker pour les mettre à disposition des différents environnements cibles (que ce soit votre serveur de production, dans un Kubernetes, etc). Docker fournit un registre par défaut qui s&#039;appelle Docker Hub. C&#039;est sur ce service que Docker va chercher les images qu&#039;il ne connaît pas encore localement (par exemple depuis un &lt;code&gt;FROM xxx&lt;/code&gt; dans un Dockerfile ou depuis un docker-compose.yml). La plupart des systèmes de gestion de code comme GitHub ou GitLab fournissent également un registre de conteneur pour stocker de manière privée vos images Docker. Ces images, dans le cadre d&#039;&lt;em&gt;ArSol&lt;/em&gt;, sont stockées dans le registre GitLab du client.&lt;/p&gt;
&lt;p&gt;Une fois que tout est prêt, nous obtenons le docker-compose.yml suivant (simplifié dans le cadre de cet article) :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  postgres-data&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  caddy_data&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  caddy_config&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;services&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  frontend&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    image&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;&amp;#x3C;url du registre&gt;/arsol/frontend:2025.10.23&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    restart&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;unless-stopped&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    env_file&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;.env&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    depends_on&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;      postgres&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        condition&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;service_healthy&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;      meilisearch&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        condition&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;service_healthy&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    ports&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;      - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;80:80&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;      - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;443:443&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;      - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;443:443/udp&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    volumes&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;      - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;caddy_data:/data&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;      - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;caddy_config:/config&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  postgres&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    image&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;&amp;#x3C;url du registre&gt;/arsol/postgres:2025.10.23&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    restart&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;unless-stopped&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    env_file&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;.env&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    volumes&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;      - &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;postgres-data:/var/lib/postgresql/data&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    healthcheck&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;      test&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: [&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;CMD-SHELL&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;pg_isready -U app&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;      interval&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;5s&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;      timeout&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;5s&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;      retries&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;5&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  worker-messenger&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    image&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;&amp;#x3C;url du registre&gt;/arsol/worker-messenger:2025.10.23&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    restart&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;unless-stopped&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    env_file&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;.env&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    depends_on&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;      frontend&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;          condition&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;service_healthy&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;      postgres&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;        condition&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;service_healthy&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;div class=&quot;c-alert c-alert--note&quot;&gt;
    &lt;p class=&quot;c-alert__title&quot;&gt;
                    &lt;span class=&quot;c-icon c-icon--monospace&quot;&gt;
                &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; aria-hidden=&quot;true&quot; class=&quot;c-icon__svg&quot; focusable=&quot;false&quot; viewBox=&quot;0 0 70 71&quot;&gt;&lt;path fill-rule=&quot;nonzero&quot; d=&quot;M35 .9c19.3 0 35 15.7 35 35s-15.7 35-35 35-35-15.7-35-35S15.7.9 35 .9m0 5c-16.552 0-30 13.449-30 30s13.448 30 30 30c16.552.103 30-13.448 30-30 0-16.551-13.448-30-30-30m0 24.9c1.7 0 3 1.3 3 3v15.3c0 1.7-1.3 3-3 3s-3-1.3-3-3V33.8c0-1.7 1.3-3 3-3m0-11c.8 0 1.6.3 2.3.9.6.5.9 1.3.9 2.1 0 .2-.1.4-.1.6-.1.2-.1.4-.2.6s-.2.3-.3.5-.3.4-.4.5c-1.1 1.1-3.1 1.1-4.2 0-.2-.2-.3-.3-.4-.5s-.2-.3-.3-.5-.2-.4-.2-.6c-.1-.2-.1-.4-.1-.6 0-.8.3-1.6.9-2.1.5-.6 1.3-.9 2.1-.9&quot;/&gt;&lt;/svg&gt;
            &lt;/span&gt;
                        &lt;strong&gt;Info&lt;/strong&gt;
    &lt;/p&gt;
    &lt;div class=&quot;c-alert__content&quot;&gt;
                &lt;p&gt;
Les volumes pour caddy sont importants pour permettre la génération automatique des certificats SSL.&lt;/p&gt;
        &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Vous noterez que nous avons spécifié, pour chaque image, un tag basé sur une date (en l&#039;occurrence &lt;code&gt;2025.10.23&lt;/code&gt;). En effet, quand Docker a déjà récupéré un tag pour une image donnée, il ne cherchera pas à la mettre à jour à moins de nettoyer les images locales (ou à moins de forcer le &lt;em&gt;pull&lt;/em&gt; avec l&#039;option &lt;code&gt;docker run --pull=always&lt;/code&gt;). Si on utilisait un tag fixe (comme &lt;code&gt;latest&lt;/code&gt; par exemple), les images ne seraient jamais mises à jour sur la machine, quand bien même le tag en question aurait changé sur le registre pour cibler une nouvelle version.&lt;/p&gt;
&lt;p&gt;Une fois le docker-compose.yml configuré, et le fichier &lt;code&gt;.env&lt;/code&gt; créé, nous pouvons lancer &lt;code&gt;docker compose -f docker-compose.yml up -d&lt;/code&gt;, et voilà 🎉 : l&#039;infrastructure de production est opérationnelle en HTTP et HTTPS.&lt;/p&gt;
&lt;p&gt;La seule différence pour mettre en place une instance OP sera le contenu du &lt;code&gt;.env&lt;/code&gt; pour activer/désactiver certaines fonctionnalités spécifiques à ce mode (comme les écrans pour déclencher la synchronisation avec le SaaS, ou la désactivation des données des autres sites archéologiques). Et pour déployer une nouvelle version, il nous faut construire et taguer une nouvelle version de nos images, mettre à jour le docker-compose.yml pour utiliser la bonne version des images et relancer la commande &lt;code&gt;docker compose&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Maintenant que l&#039;objectif est clair, voyons en détails comment y parvenir.&lt;/p&gt;
&lt;h2&gt;Construction des images&lt;/h2&gt;
&lt;p&gt;Ici, nous voulons construire toutes les images Docker nécessaires pour faire tourner le projet. À cette étape, nous devons considérer deux cas, suivant si nous utilisons des images publiques telles quelles ou s&#039;il s&#039;agit de nos propres images spécifiques à &lt;em&gt;ArSol&lt;/em&gt;.&lt;/p&gt;
&lt;h3&gt;Images publiques&lt;/h3&gt;
&lt;p&gt;Dans un premier temps, parlons des images publiques que nous utilisons telles quelles (comme pour Postgres ou Meilisearch). Nous pourrions réutiliser ces images présentes sur le Docker Hub. Mais à la place, nous allons plutôt taguer ces images avec notre système de tag et les pousser sur notre propre registre Docker. Cela apporte plusieurs avantages :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;toutes les images du projet utilisent le même tag (plus simple pour s&#039;y retrouver) ;&lt;/li&gt;
&lt;li&gt;le projet n&#039;est dépendant que d&#039;un seul registre Docker, celui du client.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Pour celles-ci, nous allons simplement créer un nouveau tag sur les images en question et les publier sur notre registre Docker privé :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;# Tag de l&#039;image&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;docker&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; image&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; tag&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;le&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; nom&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; de&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; l&#039;image&gt;:&amp;#x3C;la version de l&#039;imag&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; du&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; registr&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;/arsol/&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;le&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; nom&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; de&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; l&#039;image chez nous&gt;:&amp;#x3C;la version de l&#039;applicati&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;# Publication de l&#039;image sur le registre&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;docker&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; image&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; push&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; --disable-content-trust&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; du&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; registr&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;/arsol/&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;le&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; nom&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; de&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; l&#039;image chez nous&gt;:&amp;#x3C;la version de l&#039;applicati&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;div class=&quot;c-alert c-alert--note&quot;&gt;
    &lt;p class=&quot;c-alert__title&quot;&gt;
                    &lt;span class=&quot;c-icon c-icon--monospace&quot;&gt;
                &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; aria-hidden=&quot;true&quot; class=&quot;c-icon__svg&quot; focusable=&quot;false&quot; viewBox=&quot;0 0 70 71&quot;&gt;&lt;path fill-rule=&quot;nonzero&quot; d=&quot;M35 .9c19.3 0 35 15.7 35 35s-15.7 35-35 35-35-15.7-35-35S15.7.9 35 .9m0 5c-16.552 0-30 13.449-30 30s13.448 30 30 30c16.552.103 30-13.448 30-30 0-16.551-13.448-30-30-30m0 24.9c1.7 0 3 1.3 3 3v15.3c0 1.7-1.3 3-3 3s-3-1.3-3-3V33.8c0-1.7 1.3-3 3-3m0-11c.8 0 1.6.3 2.3.9.6.5.9 1.3.9 2.1 0 .2-.1.4-.1.6-.1.2-.1.4-.2.6s-.2.3-.3.5-.3.4-.4.5c-1.1 1.1-3.1 1.1-4.2 0-.2-.2-.3-.3-.4-.5s-.2-.3-.3-.5-.2-.4-.2-.6c-.1-.2-.1-.4-.1-.6 0-.8.3-1.6.9-2.1.5-.6 1.3-.9 2.1-.9&quot;/&gt;&lt;/svg&gt;
            &lt;/span&gt;
                        &lt;strong&gt;Info&lt;/strong&gt;
    &lt;/p&gt;
    &lt;div class=&quot;c-alert__content&quot;&gt;
                &lt;p&gt;
Ici, nous n&#039;allons pas utiliser le système de signature des images, donc nous désactivons la validation des images côté registre en utilisant l&#039;option &lt;code&gt;--disable-content-trust&lt;/code&gt;.&lt;/p&gt;
        &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Par exemple, pour meilisearch, cela nous donnerait quelque comme cela pour publier le tag &amp;quot;daté&amp;quot; ainsi que le tag &lt;code&gt;latest&lt;/code&gt; :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;docker&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; image&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; tag&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; getmeili/meilisearch:v1.16&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; du&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; registr&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;:4567/plancq/arsol/meilisearch:2025.10.23&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;docker&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; image&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; tag&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; getmeili/meilisearch:v1.16&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; du&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; registr&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;:4567/plancq/arsol/meilisearch:latest&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;docker&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; image&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; push&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; --disable-content-trust&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; du&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; registr&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;:4567/plancq/arsol/meilisearch:2025.10.23&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;docker&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; image&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; push&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; --disable-content-trust&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; du&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; registr&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;:4567/plancq/arsol/meilisearch:latest&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Nous pouvons maintenant utiliser cette image directement dans notre docker-compose.yml.&lt;/p&gt;
&lt;h3&gt;Images applicatives&lt;/h3&gt;
&lt;p&gt;En revanche, pour les images avec PHP (frontend et worker) contenant le code de l&#039;application, les dépendances &amp;amp; cie, c&#039;est un peu plus compliqué comme nous allons le voir.&lt;/p&gt;
&lt;h4&gt;La stack de dev comme base&lt;/h4&gt;
&lt;p&gt;Nous allons nous servir des images de la stack de dev comme base pour nos images de production. En effet, dans Docker-starter, nos images customs suivent déjà plusieurs bonnes pratiques, notamment pour optimiser leur poids :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;les instructions RUN sont regroupées le plus possible pour réduire le nombre de couches de l&#039;image (layer squashing) ;&lt;/li&gt;
&lt;li&gt;un nettoyage immédiat du cache et des fichiers temporaires est fait pour chaque commande afin de diminuer la taille de chaque layer, et donc le poids final de l&#039;image ;&lt;/li&gt;
&lt;li&gt;le build &amp;quot;multi-stage&amp;quot; est utilisé pour ne pas inclure les outils de dev dans l&#039;image finale (composer, nodejs, yarn, etc) mais uniquement dans une image &lt;em&gt;builder&lt;/em&gt; utilisée quand il y a besoin de ces outils.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Pour la production, nous allons appliquer la même logique. Nous créerons donc un &lt;code&gt;Dockerfile&lt;/code&gt; unique avec plusieurs stages qui nous donnera les différentes images finales à construire, mais en partant des différentes images de dev pour éviter d&#039;avoir à dupliquer et maintenir une autre installation de PHP dans la bonne version, avec les bonnes extensions, configurer FrankenPHP et caddy, etc.&lt;/p&gt;
&lt;p&gt;Voyons à quoi ressemble ce Dockerfile dans les grandes lignes.&lt;/p&gt;
&lt;h4&gt;Le builder et la préparation de l&#039;application&lt;/h4&gt;
&lt;p&gt;En premier, nous définissons un stage &amp;quot;builder&amp;quot;, qui se base sur notre builder de dev et va faire toutes les étapes nécessaires pour installer le projet (installations composer et yarn, construction des assets, etc) :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;ARG&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; PROJECT_NAME&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; ${PROJECT_NAME}-builder &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;AS&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; production-builder&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; APP_ENV=prod&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; COMPOSER_MIRROR_PATH_REPOS=1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; NODE_ENV=production&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;# C&#039;est dans ce dossier que nous allons travailler&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;WORKDIR&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; /var/www&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;# On récupère les fichiers composer.json et composer.lock et on lance Composer&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;COPY&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; composer.* /var/www/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;RUN&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; composer install \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    --no-dev \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    --prefer-dist \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    --no-scripts \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    --no-interaction \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    &amp;#x26;&amp;#x26; composer clear-cache&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;# Pareil pour Yarn&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;COPY&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; package.json yarn.lock .yarnrc.yml /var/www/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;RUN&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; yarn install --immutable&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;# On récupère le reste des fichiers&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;COPY&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; . /var/www/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;# Et enfin, on lance toutes les tasks nécessaires pour avoir l&#039;application opérationnelle &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;RUN&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; composer dump-autoload --optimize \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    &amp;#x26;&amp;#x26; yarn run build \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    &amp;#x26;&amp;#x26; bin/console cache:warmup \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    &amp;#x26;&amp;#x26; bin/console assets:install public --relative \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    &amp;#x26;&amp;#x26; rm -rf node_modules&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Plusieurs choses sont à noter ici. Déjà, vous remarquez que nous mentionnons un argument de build &lt;code&gt;PROJECT_NAME&lt;/code&gt; pour préfixer le nom de l&#039;image de base. Nous verrons dans le prochain article pourquoi c&#039;est nécessaire. Dites vous dans un premier temps que la variable a comme valeur &lt;code&gt;arsol&lt;/code&gt;, ce qui correspond au nom du projet Docker compose de la stack de dev en local.&lt;/p&gt;

&lt;div class=&quot;c-alert c-alert--note&quot;&gt;
    &lt;p class=&quot;c-alert__title&quot;&gt;
                    &lt;span class=&quot;c-icon c-icon--monospace&quot;&gt;
                &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; aria-hidden=&quot;true&quot; class=&quot;c-icon__svg&quot; focusable=&quot;false&quot; viewBox=&quot;0 0 70 71&quot;&gt;&lt;path fill-rule=&quot;nonzero&quot; d=&quot;M35 .9c19.3 0 35 15.7 35 35s-15.7 35-35 35-35-15.7-35-35S15.7.9 35 .9m0 5c-16.552 0-30 13.449-30 30s13.448 30 30 30c16.552.103 30-13.448 30-30 0-16.551-13.448-30-30-30m0 24.9c1.7 0 3 1.3 3 3v15.3c0 1.7-1.3 3-3 3s-3-1.3-3-3V33.8c0-1.7 1.3-3 3-3m0-11c.8 0 1.6.3 2.3.9.6.5.9 1.3.9 2.1 0 .2-.1.4-.1.6-.1.2-.1.4-.2.6s-.2.3-.3.5-.3.4-.4.5c-1.1 1.1-3.1 1.1-4.2 0-.2-.2-.3-.3-.4-.5s-.2-.3-.3-.5-.2-.4-.2-.6c-.1-.2-.1-.4-.1-.6 0-.8.3-1.6.9-2.1.5-.6 1.3-.9 2.1-.9&quot;/&gt;&lt;/svg&gt;
            &lt;/span&gt;
                        &lt;strong&gt;Info&lt;/strong&gt;
    &lt;/p&gt;
    &lt;div class=&quot;c-alert__content&quot;&gt;
                &lt;p&gt;
J&#039;ai voulu dissocier le Dockerfile de la stack de dev du Dockerfile de la stack de prod, d&#039;où la nécessité de pouvoir référencer l&#039;image de la stack de dev. Si nous avions mergé les deux Dockerfile, nous n&#039;aurions pas eu besoin de cette variable &lt;code&gt;PROJECT_NAME&lt;/code&gt;.&lt;/p&gt;
        &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Ensuite, vous vous demandez peut-être la raison pour laquelle nous effectuons l&#039;installation de Composer et Yarn &lt;strong&gt;avant&lt;/strong&gt; de &lt;code&gt;COPY&lt;/code&gt; le code et l&#039;ensemble des fichiers de l&#039;application. Cette approche permet de tirer parti du cache de couches : Docker commence la construction en vérifiant le cache pour la première instruction et, en cas de correspondance, il réutilise la couche et passe à l&#039;instruction suivante. Mais si une instruction invalide le cache (par exemple, un &lt;code&gt;COPY&lt;/code&gt; avec un fichier modifié), toutes les instructions suivantes seront exécutées sans utiliser le cache, ce qui ralentit la construction. Étant donné que les dépendances sont moins sujettes à changement que le code, il est plus probable que les étapes d&#039;installation de Composer et Yarn soient réutilisées depuis le cache, car elles précèdent l&#039;opération de &lt;code&gt;COPY&lt;/code&gt; du code.&lt;/p&gt;
&lt;p&gt;On peut maintenant préparer le stage docker qui contiendra uniquement php et les outils nécessaires pour le runtime (FrankenPHP, Caddy, etc), en se basant sur l&#039;image du conteneur frontend :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;ARG&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; PROJECT_NAME&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; ${PROJECT_NAME}-frontend &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;AS&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; production-php-base&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;WORKDIR&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; /var/www&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;# Symfony tournera dans son env prod&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; APP_ENV=prod&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;# On récupère le code de l&#039;application, ses dépendances et assets depuis le stage builder vu précédemment&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;COPY&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; --from=production-builder /var/www /var/www&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Il faut bien faire attention à ce qui est inclus dans les conteneurs. C&#039;est pour cette raison que nous allons créer un &lt;code&gt;Dockerfile.gitignore&lt;/code&gt; au même niveau que le &lt;code&gt;Dockerfile&lt;/code&gt; du projet. On retire tout ce qui n&#039;est pas nécessaire, comme les dépendances ou les assets qui auraient été installées/construites dans votre stack de dev :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;.castor/
.castor.stub.php
.env.local
.env.ci
*.cache
.git/
.idea/
.home/
.yarn/
doc/
infrastructure/
!infrastructure/docker/services/php-production/
tests/
tools/
node_modules/
var/
vendor/
public/assets/
public/build/
public/bundles/
public/media/
!public/media/.gitkeep
&lt;/code&gt;&lt;/pre&gt;

&lt;div class=&quot;c-alert c-alert--note&quot;&gt;
    &lt;p class=&quot;c-alert__title&quot;&gt;
                    &lt;span class=&quot;c-icon c-icon--monospace&quot;&gt;
                &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; aria-hidden=&quot;true&quot; class=&quot;c-icon__svg&quot; focusable=&quot;false&quot; viewBox=&quot;0 0 70 71&quot;&gt;&lt;path fill-rule=&quot;nonzero&quot; d=&quot;M35 .9c19.3 0 35 15.7 35 35s-15.7 35-35 35-35-15.7-35-35S15.7.9 35 .9m0 5c-16.552 0-30 13.449-30 30s13.448 30 30 30c16.552.103 30-13.448 30-30 0-16.551-13.448-30-30-30m0 24.9c1.7 0 3 1.3 3 3v15.3c0 1.7-1.3 3-3 3s-3-1.3-3-3V33.8c0-1.7 1.3-3 3-3m0-11c.8 0 1.6.3 2.3.9.6.5.9 1.3.9 2.1 0 .2-.1.4-.1.6-.1.2-.1.4-.2.6s-.2.3-.3.5-.3.4-.4.5c-1.1 1.1-3.1 1.1-4.2 0-.2-.2-.3-.3-.4-.5s-.2-.3-.3-.5-.2-.4-.2-.6c-.1-.2-.1-.4-.1-.6 0-.8.3-1.6.9-2.1.5-.6 1.3-.9 2.1-.9&quot;/&gt;&lt;/svg&gt;
            &lt;/span&gt;
                        &lt;strong&gt;Info&lt;/strong&gt;
    &lt;/p&gt;
    &lt;div class=&quot;c-alert__content&quot;&gt;
                &lt;p&gt;
Après réflexion, on aurait peut-être mieux fait de tout bloquer par défaut et ne lister que ce qu&#039;il fallait garder (src, config, public, etc). 😝&lt;/p&gt;
        &lt;/div&gt;
&lt;/div&gt;

&lt;h4&gt;Frontend et worker&lt;/h4&gt;
&lt;p&gt;Maintenant que nous avons un stage avec l&#039;application opérationnelle, nous allons pouvoir construire les images finales pour notre projet. Voilà l&#039;image qui se base sur le stage construit ci-dessus :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; production-php-base &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;AS&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; production-frontend&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;# Mise en place d&#039;un entrypoint qui s&#039;occupera d&#039;initialiser l&#039;application&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;COPY&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; infrastructure/docker/services/php-production/entrypoint-frontend.sh /entrypoint.sh&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;# Configuration de Caddy&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;COPY&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; infrastructure/docker/services/php-production/etc/. /etc/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;RUN&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;chmod&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;+x&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;/entrypoint.sh&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;ENTRYPOINT&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;/entrypoint.sh&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;# Indique les ports utilisés par ce conteneur &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;EXPOSE&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; 80&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;EXPOSE&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; 443&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;# Commande qui sera exécutée dans le conteneur&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;CMD&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; [ &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;frankenphp&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;run&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;--config&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;/etc/caddy/Caddyfile&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;--adapter&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;caddyfile&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Nous avons défini un entrypoint pour ce conteneur. Lors du démarrage de ce dernier, il permet d&#039;initialiser toute la partie data (schéma SQL, migrations Doctrine à jouer, configuration du transport pour Messenger, indexation des données dans Meilisearch). Cela est rendu possible car nous n&#039;aurons toujours qu&#039;une seule instance de ce conteneur en production (aucun pic de trafic à gérer). Si ce n&#039;est pas votre cas, il faudra peut-être adapter cette technique.&lt;/p&gt;
&lt;p&gt;Voilà à quoi ressemble cet entrypoint :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;#!/bin/bash&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-9&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; -e&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-9&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &quot;Updating all databases...&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;php&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; bin/console&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; doctrine:database:create&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; --if-not-exists&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; --env=prod&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; --no-interaction&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;php&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; bin/console&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; doctrine:migrations:sync-metadata-storage&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; --env=prod&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; --no-interaction&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;php&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; bin/console&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; doctrine:migrations:migrate&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; --env=prod&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; --no-interaction&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;php&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; bin/console&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; messenger:setup-transports&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; --env=prod&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; --no-interaction&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;php&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; bin/console&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; app:meilisearch:index&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; --env=prod&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-9&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &quot;Ready to start the frontend service.&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-9&quot;&gt;exec&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &quot;&lt;/span&gt;&lt;span class=&quot;syntax-12&quot;&gt;$@&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Enfin, il ne nous manque plus que le stage qui permettra de construire l&#039;image faisant tourner le conteneur pour le worker Messenger :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; production-php-base &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;AS&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; production-worker-messenger&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;RUN&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; apt-get update \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    &amp;#x26;&amp;#x26; apt-get install -y --no-install-recommends \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;        procps \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    &amp;#x26;&amp;#x26; apt-get clean \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    &amp;#x26;&amp;#x26; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;CMD&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;php&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;-d&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;memory_limit=-1&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;bin/console&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;messenger:consume&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;-vv&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;async&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ici, on note l&#039;installation de &lt;code&gt;procps&lt;/code&gt; qui fournit le binaire pgrep, utile pour vérifier si le processus qui fait tourner le worker est toujours actif. Il sera employé dans le healthcheck de ce service :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;services&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;  worker-messenger&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;    # ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    healthcheck&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;      test&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: [&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;CMD-SHELL&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&quot;pgrep -f &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;messenger:consume&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; || exit 1&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;      interval&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;5s&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;      timeout&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;5s&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;      retries&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Grâce au multi-stage de Docker, nous avons ainsi pu construire toutes nos images utilisant PHP dans un même Dockerfile.&lt;/p&gt;
&lt;h4&gt;A table !&lt;/h4&gt;
&lt;p&gt;Maintenant que nos images peuvent être construites, il va nous falloir les taguer puis les envoyer sur le registre. On pourrait lancer les mêmes commandes &lt;code&gt;docker image tag|push&lt;/code&gt; vues précédemment. Mais à la place, on va simplifier et automatiser le processus grâce à &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://docs.docker.com/build/bake/&quot;&gt;Bake&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Cet outil permet de définir l&#039;ensemble des cibles de build dans un fichier de configuration (&lt;code&gt;bake.hcl&lt;/code&gt; par exemple) et de les construire/pousser en une seule commande. Voici un extrait de ce à quoi ressemble notre fichier bake :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-6&quot;&gt;group&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; &quot;default&quot; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  targets &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;    &quot;frontend&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-1&quot;&gt;    &quot;worker-messenger&quot;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-6&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; &quot;frontend&quot; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  context    &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &quot;.&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  dockerfile &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &quot;./infrastructure/docker/services/php-production/Dockerfile&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  target     &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &quot;production-frontend&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-6&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; &quot;worker-messenger&quot; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  context    &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &quot;.&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  dockerfile &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &quot;./infrastructure/docker/services/php-production/Dockerfile&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;  target     &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; &quot;production-worker-messenger&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Avec ce fichier, il ne nous reste qu&#039;à lancer la commande suivant pour construire les images, les tagger et les envoyer au registre docker :&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;docker&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; buildx&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; bake&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; --file&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; bake.hcl&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; --push&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;div class=&quot;c-alert c-alert--note&quot;&gt;
    &lt;p class=&quot;c-alert__title&quot;&gt;
                    &lt;span class=&quot;c-icon c-icon--monospace&quot;&gt;
                &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; aria-hidden=&quot;true&quot; class=&quot;c-icon__svg&quot; focusable=&quot;false&quot; viewBox=&quot;0 0 70 71&quot;&gt;&lt;path fill-rule=&quot;nonzero&quot; d=&quot;M35 .9c19.3 0 35 15.7 35 35s-15.7 35-35 35-35-15.7-35-35S15.7.9 35 .9m0 5c-16.552 0-30 13.449-30 30s13.448 30 30 30c16.552.103 30-13.448 30-30 0-16.551-13.448-30-30-30m0 24.9c1.7 0 3 1.3 3 3v15.3c0 1.7-1.3 3-3 3s-3-1.3-3-3V33.8c0-1.7 1.3-3 3-3m0-11c.8 0 1.6.3 2.3.9.6.5.9 1.3.9 2.1 0 .2-.1.4-.1.6-.1.2-.1.4-.2.6s-.2.3-.3.5-.3.4-.4.5c-1.1 1.1-3.1 1.1-4.2 0-.2-.2-.3-.3-.4-.5s-.2-.3-.3-.5-.2-.4-.2-.6c-.1-.2-.1-.4-.1-.6 0-.8.3-1.6.9-2.1.5-.6 1.3-.9 2.1-.9&quot;/&gt;&lt;/svg&gt;
            &lt;/span&gt;
                        &lt;strong&gt;Info&lt;/strong&gt;
    &lt;/p&gt;
    &lt;div class=&quot;c-alert__content&quot;&gt;
                &lt;p&gt;
Malheureusement, Bake n&#039;a pas l&#039;air de permettre de juste taguer des images existantes, donc nous ne pourrons pas l&#039;utiliser pour remplacer les &lt;code&gt;docker image tag|push&lt;/code&gt; des images publiques.&lt;/p&gt;
        &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Nos images sont maintenant disponibles sur le registre du client :&lt;/p&gt;
&lt;p&gt;&lt;picture&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;/media/cache/content-webp/2026/on-premise-docker-castor/arsol-docker-registry.f99c2888.webp&quot; /&gt;&lt;source type=&quot;image/png&quot; srcset=&quot;/media/cache/content/2026/on-premise-docker-castor/arsol-docker-registry.png&quot; /&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; style=&quot;width: 869px; ; aspect-ratio: calc(869 / 550)&quot; src=&quot;https://jolicode.com//media/cache/content/2026/on-premise-docker-castor/arsol-docker-registry.png&quot; alt=&quot;Les images disponibles sur le registre GitLab&quot; /&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Nous avons vu dans cet article une bonne partie des étapes qui nous permettent de construire les images Docker dont nous aurons besoin pour faire tourner l&#039;application dans tous nos environnements.&lt;/p&gt;
&lt;p&gt;Je n&#039;en ai pas parlé jusque-là mais il reste quelques points de sécurité à garder en tête avant de mettre en production cette infrastructure (comme les capabilities Docker ou encore les logs générés par Docker Compose qui peuvent vite remplir le disque par défaut en cas de fort trafic).&lt;/p&gt;
&lt;p&gt;Le client devant être autonome pour déployer les prochaines évolutions de l&#039;application, nous ne nous sommes pas arrêtés là. Nous avons donc mis en place tout un ensemble de task Castor permettant d&#039;automatiser la création et la publication des images, ainsi que de simplifier le pilotage de la stack dans les différents environnements. Mais nous verrons tout cela dans le prochain article.&lt;/p&gt;

        </content>
    </entry>    <entry>
        <id>https://jolicode.com/blog/automapper-10-0-high-performance-mapping-ready-for-the-future</id>
        <published>2026-02-10T14:42:00+01:00</published>
        <updated>2026-02-10T14:42:00+01:00</updated>
        <link type="text/html" rel="alternate" href="https://jolicode.com/blog/automapper-10-0-high-performance-mapping-ready-for-the-future"/>
        <title>AutoMapper 10.0: High-performance mapping ready for the future</title>
        <author>
            <name>JoliCode Team</name>
            <uri>https://jolicode.com/</uri>
        </author>            <category term="php" />            <category term="symfony" />        <summary><![CDATA[This is a major milestone for the library: AutoMapper has reached version 10.0.
While our promise remains unchanged — transforming your data from one format to another as fast as possible — this version…]]></summary>
        <content type="html">
            &lt;p&gt;This is a major milestone for the library: AutoMapper has reached version 10.0.&lt;/p&gt;
&lt;p&gt;While our promise remains unchanged — transforming your data from one format to another as fast as possible — this version marks a technological breakthrough. We took advantage of this major release to modernize the core engine and align with the latest Symfony standards: and much more!&lt;/p&gt;
&lt;h2&gt;Under the hood: The arrival of symfony/type-info&lt;/h2&gt;
&lt;p&gt;This is the most impactful invisible change. I have been working on Jane and AutoMapper for a long time, and I started from a simple observation: a tool capable of retrieving metadata in an advanced way was missing. At the time, Symfony&#039;s &lt;code&gt;PropertyInfo&lt;/code&gt; component had limited support for unions and handled neither intersections nor generics.&lt;/p&gt;
&lt;p&gt;I initially &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://github.com/symfony/symfony/pull/40457&quot;&gt;implemented the PHPStan extractor&lt;/a&gt; in &lt;code&gt;PropertyInfo&lt;/code&gt; to try to fill these gaps, but I quickly realized that the system remained limited by the component&#039;s very design. It was following discussions with Mathias Arlaud that we decided to team up to create and &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://github.com/symfony/symfony/pull/52510&quot;&gt;release the TypeInfo component&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;That is why &lt;code&gt;TypeInfo&lt;/code&gt; (introduced in Symfony 7.1) is now the new standard for obtaining even more detailed type definitions. With v10, AutoMapper switches to this component. The more precise the type definition, the more reliable and optimal the mapping process can be. This is an essential step to guarantee a much more faithful extraction of your data.&lt;/p&gt;
&lt;h3&gt;The new feature: Forced Typing&lt;/h3&gt;
&lt;p&gt;Sometimes, automatic inference isn&#039;t enough, or you want to transform data into a specific format that differs from the source property&#039;s PHP type. v10 allows you to force the target type directly via the &lt;code&gt;#[MapTo]&lt;/code&gt; attribute.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Here, we explicitly ask the mapper to transform the $number property into an array of integers in the target, even if the source is a string.&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;class&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;syntax-6&quot;&gt;Entity&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    #[MapTo(target: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;array&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;, targetPropertyType: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;int&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    public&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; string&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $number;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Interoperability: Symfony ObjectMapper Support&lt;/h2&gt;
&lt;p&gt;Much like AutoMapper&#039;s native interface, the &lt;code&gt;ObjectMapperInterface&lt;/code&gt; allows transforming a source object into a target object via a single method. The strength of this signature lies in the &lt;code&gt;$target&lt;/code&gt; parameter, which accepts either a &lt;strong&gt;class name&lt;/strong&gt; (to create a new instance) or an &lt;strong&gt;existing object&lt;/strong&gt; (to hydrate or update it).&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;interface&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;syntax-6&quot;&gt;ObjectMapperInterface&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    public&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt; map&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;object&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $source, &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;object&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $target &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt; null&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; object&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is where AutoMapper makes a difference: whereas Symfony&#039;s native implementation relies mainly on the Reflection API (which can be costly), AutoMapper generates optimized PHP code. By activating this support, you replace the default mechanism with a solution tailored for performance, which is much faster at runtime.
To activate this feature and replace Symfony&#039;s default ObjectMapper with the AutoMapper one, a single line in the bundle configuration is enough:&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;automapper&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    object_mapper&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;syntax-3&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To make this possible and efficient, we had to implement a highly anticipated feature: &lt;strong&gt;Nesting&lt;/strong&gt;. This allows reading or writing deeply nested values in your objects, drastically simplifying the transition from &amp;quot;flat&amp;quot; DTOs to rich entities.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;
Here we map a flat &lt;code&gt;UserDto&lt;/code&gt; to a &lt;code&gt;User&lt;/code&gt; containing an &lt;code&gt;Address&lt;/code&gt; object. Thanks to the &lt;code&gt;address.street&lt;/code&gt; notation, AutoMapper knows it must hydrate the sub-object.&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;class&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;syntax-6&quot;&gt;UserDto&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    #[MapTo(property: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;address.street&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    public&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; string&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $streetAddress;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    #[MapTo(property: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;address.city&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    public&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; string&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $cityAddress;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    public&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; string&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $name;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;class&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;syntax-6&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    public&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; Address&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $address;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    public&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; string&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $name;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    public&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; function&lt;/span&gt;&lt;span class=&quot;syntax-9&quot;&gt; __construct&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-11&quot;&gt;        $this&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;address &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; new&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; Address&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;class&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;syntax-6&quot;&gt;Address&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    public&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; string&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $street;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    public&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; string&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $city;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;// In use, the Address sub-object is automatically populated&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;$mapper&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;-&gt;&lt;/span&gt;&lt;span class=&quot;syntax-8&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; UserDto&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    streetAddress: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;123 Main St&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    cityAddress: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;Springfield&#039;&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    name: &lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt;&#039;John Doe&#039;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;), &lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;::class&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Polymorphism: Rethinking discriminator management&lt;/h2&gt;
&lt;p&gt;Until now, handling polymorphism relied on a dependency on the Symfony Serializer. It was limited by the necessity to specify a discrimination property. v10 improves this by allowing you to define the discrimination logic directly at the class level via the &lt;code&gt;#[Mapper]&lt;/code&gt; attribute, enabling object mapping without having to define a property to discriminate entities.
This allows for seamless mapping from DTO hierarchies to Entity hierarchies.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;
Here you define how to map the children of the abstract Pet class based on the incoming DTO type.&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;#[Mapper(discriminator: &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; Discriminator&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    mapping: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;        DogDto&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;::class&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; =&gt;&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; Dog&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;::class&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-5&quot;&gt;        CatDto&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;::class&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; =&gt;&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; Cat&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;::class&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;))]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;abstract&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; class&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class=&quot;syntax-6&quot;&gt;Pet&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;    /** &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;@var&lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt; string&lt;/span&gt;&lt;span class=&quot;syntax-10&quot;&gt; */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    public&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $name;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-10&quot;&gt;    /** &lt;/span&gt;&lt;span class=&quot;syntax-4&quot;&gt;@var&lt;/span&gt;&lt;span class=&quot;syntax-5&quot;&gt; PetOwner&lt;/span&gt;&lt;span class=&quot;syntax-10&quot;&gt; */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-4&quot;&gt;    public&lt;/span&gt;&lt;span class=&quot;syntax-2&quot;&gt; $owner;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;A new Profiler to see clearly&lt;/h2&gt;
&lt;p&gt;Mapping is often a &amp;quot;black box&amp;quot;. When data comes out malformed, understanding why can be complex.&lt;/p&gt;
&lt;p&gt;We have revamped the integration into the &lt;strong&gt;Symfony Profiler&lt;/strong&gt;. Gone are the days when you didn&#039;t know if AutoMapper had actually worked. Now, the dedicated panel allows you to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;List all mappings performed during the request.&lt;/li&gt;
&lt;li&gt;See the Source class and the Target class.&lt;/li&gt;
&lt;li&gt;Inspect the context passed to the mapper.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It is an indispensable tool for debugging your complex transformations without having to place breakpoints everywhere.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://jolicode.com//media/original/2026/automapper-v10/profiler.png&quot;&gt;&lt;picture class=&quot;js-dialog-target&quot; data-original-url=&quot;/media/original/2026/automapper-v10/profiler.png&quot; data-original-width=&quot;1289&quot; data-original-height=&quot;2259&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;/media/cache/content-webp/2026/automapper-v10/profiler.e93155e3.webp&quot; /&gt;&lt;source type=&quot;image/png&quot; srcset=&quot;/media/cache/content/2026/automapper-v10/profiler.png&quot; /&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; style=&quot;width: 996px; ; aspect-ratio: calc(1289 / 2259)&quot; src=&quot;https://jolicode.com//media/cache/content/2026/automapper-v10/profiler.png&quot; alt=&quot;Profiler&quot; /&gt;&lt;/picture&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Final Word&lt;/h2&gt;
&lt;p&gt;Version 10 is the culmination of a lot of work to modernize and sustain the library.
A huge thank you to all the contributors who participated in this release, with a special mention to &lt;a href=&quot;https://jolicode.com/qui-sommes-nous/equipe/joel-wurtz&quot;&gt;Joel Wurtz&lt;/a&gt; for his colossal investment in this major version.&lt;/p&gt;
&lt;p&gt;To go further, everything happens here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;📖 &lt;strong&gt;Documentation&lt;/strong&gt;: &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://automapper.jolicode.com/&quot;&gt;https://automapper.jolicode.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;🐙 &lt;strong&gt;GitHub repository&lt;/strong&gt;: &lt;a rel=&quot;nofollow noopener noreferrer&quot; href=&quot;https://github.com/jolicode/automapper&quot;&gt;https://github.com/jolicode/automapper&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Make sure your environment is running PHP 8.4 or higher and run:&lt;/p&gt;
&lt;pre class=&quot;syntax-0&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;syntax-8&quot;&gt;composer&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; require&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; jolicode/automapper&lt;/span&gt;&lt;span class=&quot;syntax-1&quot;&gt; ^10.0&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

        </content>
    </entry></feed>
