{"id":1303,"date":"2024-07-23T12:19:48","date_gmt":"2024-07-23T12:19:48","guid":{"rendered":"https:\/\/dockerpros.com\/?post_type=glossary&#038;p=1303"},"modified":"2024-07-23T12:22:52","modified_gmt":"2024-07-23T12:22:52","slug":"volumes","status":"publish","type":"glossary","link":"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose-config-volumes\/","title":{"rendered":"Configuration Docker Compose \u2013 volumes"},"content":{"rendered":"<h1>Comprendre la configuration Docker Compose \u2013volumes<\/h1>\n<p><span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose is a tool for defining and running multi-container Docker applications using a YAML file. It simplifies deployment, configuration, and orchestration of services, enhancing development efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> is a powerful tool that allows developers to define and manage multi-container Docker applications. One of the central components of <span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose is a tool for defining and running multi-container Docker applications using a YAML file. It simplifies deployment, configuration, and orchestration of services, enhancing development efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> is its configuration file, typically named <code>docker-compose.yml<\/code>, qui permet aux utilisateurs de sp\u00e9cifier divers param\u00e8tres pour leurs applications. Parmi ces param\u00e8tres, <code>volumes<\/code> jouent un r\u00f4le crucial dans la gestion des donn\u00e9es persistantes et le partage de fichiers entre les conteneurs et le syst\u00e8me h\u00f4te. Dans cet article, nous allons nous plonger dans les d\u00e9tails des <code>--volumes<\/code> option in <span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose is a tool for defining and running multi-container Docker applications using a YAML file. It simplifies deployment, configuration, and orchestration of services, enhancing development efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, exploring its syntax, usage, best practices, and some advanced concepts.<\/p>\n<h2>What Are Volumes?<\/h2>\n<p>Dans Docker, un <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\" target=\"_blank\">volume<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> is a persistent storage mechanism that exists outside of the container\u2019s filesystem. This is important because containers are ephemeral by nature, meaning that any data stored within a <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> will be lost if that <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> is stopped or removed. Volumes provide a way to persist data across <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> lifecycles and can be shared between multiple containers. This can be particularly useful for databases, file storage, or any application requiring a consistent data state.<\/p>\n<h2>The Role of Volumes in Docker Compose<\/h2>\n<p>Lors de l'utilisation de <span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose is a tool for defining and running multi-container Docker applications using a YAML file. It simplifies deployment, configuration, and orchestration of services, enhancing development efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, specifying volumes in the <code>docker-compose.yml<\/code> permet de d\u00e9clarer comment et o\u00f9 les donn\u00e9es doivent \u00eatre stock\u00e9es. Le <code>volumes<\/code> Cette section du fichier de configuration vous permet de d\u00e9finir \u00e0 la fois des volumes nomm\u00e9s (g\u00e9r\u00e9s par Docker) et des montages de liaison (li\u00e9s directement au syst\u00e8me de fichiers h\u00f4te). Cette flexibilit\u00e9 est essentielle pour d\u00e9velopper des applications robustes qui n\u00e9cessitent une persistance des donn\u00e9es ou doivent partager des donn\u00e9es entre services.<\/p>\n<h2>Syntax of the <code>volumes<\/code> Section<\/h2>\n<p>The <code>volumes<\/code> section dans un <span class=\"glossaryai-tooltip glossary-term-689\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose-file\/\" target=\"_blank\">fichier Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Un fichier Docker Compose est un fichier de configuration YAML qui d\u00e9finit les services, les r\u00e9seaux et les volumes pour les applications Docker multi-conteneurs. Il simplifie le d\u00e9ploiement et la gestion, am\u00e9liorant ainsi l'efficacit\u00e9.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose-file\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> peut \u00eatre d\u00e9fini \u00e0 diff\u00e9rents niveaux :<\/p>\n<ol>\n<li><strong>Niveau mondial<\/strong>: This defines volumes that can be used by any <span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/service\/\" target=\"_blank\">service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Le service fait r\u00e9f\u00e9rence \u00e0 l'acte de fournir une assistance ou un soutien pour r\u00e9pondre \u00e0 des besoins ou des exigences sp\u00e9cifiques. Dans divers domaines, il englobe le service client, le support technique et les services professionnels, en mettant l'accent sur l'efficacit\u00e9 et la satisfaction de l'utilisateur.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> dans le m\u00eame fichier Compose.<\/li>\n<li><strong><span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/service\/\" target=\"_blank\">Service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Le service fait r\u00e9f\u00e9rence \u00e0 l'acte de fournir une assistance ou un soutien pour r\u00e9pondre \u00e0 des besoins ou des exigences sp\u00e9cifiques. Dans divers domaines, il englobe le service client, le support technique et les services professionnels, en mettant l'accent sur l'efficacit\u00e9 et la satisfaction de l'utilisateur.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> Level<\/strong>: This defines volumes that are specific to a particular <span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/service\/\" target=\"_blank\">service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Le service fait r\u00e9f\u00e9rence \u00e0 l'acte de fournir une assistance ou un soutien pour r\u00e9pondre \u00e0 des besoins ou des exigences sp\u00e9cifiques. Dans divers domaines, il englobe le service client, le support technique et les services professionnels, en mettant l'accent sur l'efficacit\u00e9 et la satisfaction de l'utilisateur.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>.<\/li>\n<\/ol>\n<p>Here\u2019s an example of a basic <code>docker-compose.yml<\/code> file demonstrating both levels of <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\" target=\"_blank\">volume<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> definitions:<\/p>\n<pre><code class=\"language-yaml\">version: '3.8'\n\nservices:\n  web:\n    <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Une image est une repr\u00e9sentation visuelle d'un objet ou d'une sc\u00e8ne, g\u00e9n\u00e9ralement compos\u00e9e de pixels dans les formats num\u00e9riques. Elle peut transmettre des informations, susciter des \u00e9motions et faciliter la communication \u00e0 travers diff\u00e9rents m\u00e9dias.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>: nginx\n    volumes:\n      - web_data:\/usr\/share\/nginx\/html\n      - .\/config\/nginx.conf:\/etc\/nginx\/nginx.conf\n\n  db:\n    <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Une image est une repr\u00e9sentation visuelle d'un objet ou d'une sc\u00e8ne, g\u00e9n\u00e9ralement compos\u00e9e de pixels dans les formats num\u00e9riques. Elle peut transmettre des informations, susciter des \u00e9motions et faciliter la communication \u00e0 travers diff\u00e9rents m\u00e9dias.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>: postgres\n    volumes:\n      - db_data:\/var\/lib\/postgresql\/data\n\nvolumes:\n  web_data:\n  db_data:<\/code><\/pre>\n<h3>Explanation of the Example<\/h3>\n<ul>\n<li><strong>Global Level Volumes<\/strong>: Under the <code>volumes<\/code> section outside of services, <code>web_data<\/code> and <code>db_data<\/code> are declared. These named volumes will be managed by Docker and persist beyond the lifecycle of the containers using them.<\/li>\n<li><strong><span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/service\/\" target=\"_blank\">Service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Le service fait r\u00e9f\u00e9rence \u00e0 l'acte de fournir une assistance ou un soutien pour r\u00e9pondre \u00e0 des besoins ou des exigences sp\u00e9cifiques. Dans divers domaines, il englobe le service client, le support technique et les services professionnels, en mettant l'accent sur l'efficacit\u00e9 et la satisfaction de l'utilisateur.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> Level Volumes<\/strong>Le <code>web<\/code> <span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/service\/\" target=\"_blank\">service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Le service fait r\u00e9f\u00e9rence \u00e0 l'acte de fournir une assistance ou un soutien pour r\u00e9pondre \u00e0 des besoins ou des exigences sp\u00e9cifiques. Dans divers domaines, il englobe le service client, le support technique et les services professionnels, en mettant l'accent sur l'efficacit\u00e9 et la satisfaction de l'utilisateur.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> uses <code>web_data<\/code>, which points to a specific directory in the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. It also uses a <span class=\"glossaryai-tooltip glossary-term-700\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/bind-mount\/\" target=\"_blank\">bind mount<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A bind mount is a method in Linux that allows a directory to be mounted at multiple locations in the filesystem. This enables flexible file access without duplicating data, enhancing resource management.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/bind-mount\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> pour lier un fichier de configuration local (<code>nginx.conf<\/code>) to the container\u2019s configuration path. The <code>db<\/code> <span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/service\/\" target=\"_blank\">service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Le service fait r\u00e9f\u00e9rence \u00e0 l'acte de fournir une assistance ou un soutien pour r\u00e9pondre \u00e0 des besoins ou des exigences sp\u00e9cifiques. Dans divers domaines, il englobe le service client, le support technique et les services professionnels, en mettant l'accent sur l'efficacit\u00e9 et la satisfaction de l'utilisateur.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> uses <code>db_data<\/code> pour persister les donn\u00e9es PostgreSQL.<\/li>\n<\/ul>\n<h2>Benefits of Using Volumes<\/h2>\n<h3>Persistance des donn\u00e9es<\/h3>\n<p>One of the primary benefits of using volumes is data persistence. Whether it\u2019s application logs, database files, or user uploads, volumes ensure that data remains accessible even if a <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> is stopped or recreated. This is crucial for production environments where data integrity is paramount.<\/p>\n<h3>Improved Sharing Between Containers<\/h3>\n<p>Volumes facilitate data sharing between containers. For instance, if one <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> generates data that another <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> needs to access, you can define a shared <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\" target=\"_blank\">volume<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> to enable this interaction seamlessly. This is particularly useful in microservices architectures where multiple services may need to read from or write to a common data store.<\/p>\n<h3>Simplified Upgrades and Maintenance<\/h3>\n<p>When using volumes, upgrading or maintaining applications becomes more straightforward. If you need to update a <span class=\"glossaryai-tooltip glossary-term-681\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/service\/\" target=\"_blank\">service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Le service fait r\u00e9f\u00e9rence \u00e0 l'acte de fournir une assistance ou un soutien pour r\u00e9pondre \u00e0 des besoins ou des exigences sp\u00e9cifiques. Dans divers domaines, il englobe le service client, le support technique et les services professionnels, en mettant l'accent sur l'efficacit\u00e9 et la satisfaction de l'utilisateur.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> or deploy a new version, you can ensure that the associated data persists without worrying about data loss. This helps in managing continuous integration and continuous deployment (CI\/CD) pipelines effectively.<\/p>\n<h3>Performance am\u00e9lior\u00e9e<\/h3>\n<p>Volumes provide better performance compared to storing data in the container&#8217;s writable layer. Since volumes are managed by Docker and stored outside the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> filesystem, they can read and write data more efficiently. This is particularly noticeable in scenarios with high I\/O operations, such as databases.<\/p>\n<h2>Types de volumes<\/h2>\n<h3>Volumes nomm\u00e9s<\/h3>\n<p>Les volumes nomm\u00e9s sont g\u00e9r\u00e9s par Docker et sont d\u00e9finis sous le <code>volumes<\/code> section dans le <code>docker-compose.yml<\/code> file. When you create a named <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\" target=\"_blank\">volume<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, Docker handles the storage location, making it easy to back up, migrate, or manage. Named volumes are typically stored in the <span class=\"glossaryai-tooltip glossary-term-701\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-volume\/\" target=\"_blank\">Volume Docker<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Volumes are essential for persistent data storage in containerized applications. They enable data separation from the container lifecycle, allowing for easier data management and backup.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> directory on the host system (e.g., <code>\/var\/lib\/docker\/volumes<\/code>).<\/p>\n<p>Example:<\/p>\n<pre><code class=\"language-yaml\">volumes:\n  my_named_volume:<\/code><\/pre>\n<h3>Montages bind<\/h3>\n<p>Bind mounts allow you to specify a path on the host machine that maps to a path in the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. This is particularly useful during development when you want to make changes to the code or configuration files without rebuilding the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. However, bind mounts can introduce dependencies on the host filesystem, which may affect portability.<\/p>\n<p>Example:<\/p>\n<pre><code class=\"language-yaml\">volumes:\n  - .\/app:\/usr\/src\/app<\/code><\/pre>\n<h3>Volumes anonymes<\/h3>\n<p>Anonymous volumes are similar to named volumes, but they do not have a specific name associated with them. They are typically used when you want to create a <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\" target=\"_blank\">volume<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> without needing to reference it later. Docker automatically generates a unique name for these volumes.<\/p>\n<p>Example:<\/p>\n<pre><code class=\"language-yaml\">services:\n  app:\n    <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Une image est une repr\u00e9sentation visuelle d'un objet ou d'une sc\u00e8ne, g\u00e9n\u00e9ralement compos\u00e9e de pixels dans les formats num\u00e9riques. Elle peut transmettre des informations, susciter des \u00e9motions et faciliter la communication \u00e0 travers diff\u00e9rents m\u00e9dias.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>: myapp\n    volumes:\n      - \/data<\/code><\/pre>\n<h2>Bonnes pratiques pour l'utilisation des volumes<\/h2>\n<ol>\n<li>\n<p><strong>Use Named Volumes for Persistence<\/strong>Lorsque vous devez assurer la persistance des donn\u00e9es, privil\u00e9giez les volumes nomm\u00e9s plut\u00f4t que les montages de liaison. Les volumes nomm\u00e9s sont plus faciles \u00e0 g\u00e9rer et peuvent \u00eatre sauvegard\u00e9s ou d\u00e9plac\u00e9s avec moins d'effort.<\/p>\n<\/li>\n<li>\n<p><strong>Utilisez les montages li\u00e9s pour le d\u00e9veloppement\n\nLes montages li\u00e9s sont un moyen simple de monter des r\u00e9pertoires sur votre h\u00f4te dans un conteneur. Les montages li\u00e9s ont une fonctionnalit\u00e9 limit\u00e9e par rapport aux volumes Docker. Par exemple, ils ne fonctionnent pas sur les h\u00f4tes Windows ou macOS. Cependant, ils sont toujours utiles pour le d\u00e9veloppement car vous pouvez monter votre code source directement dans un conteneur.\n\nPour utiliser un montage li\u00e9, vous devez d'abord cr\u00e9er un conteneur avec l'option --mount. Par exemple, pour monter le r\u00e9pertoire courant dans un conteneur, vous pouvez utiliser la commande suivante :\n\n```\ndocker run -it --mount type=bind,source=\"$(pwd)\",target=\/app alpine sh\n```\n\nCette commande cr\u00e9e un conteneur avec le r\u00e9pertoire courant mont\u00e9 dans le r\u00e9pertoire \/app du conteneur. Vous pouvez ensuite utiliser le conteneur pour d\u00e9velopper votre code.\n\nLes montages li\u00e9s sont un moyen simple et efficace de monter des r\u00e9pertoires sur votre h\u00f4te dans un conteneur. Ils sont particuli\u00e8rement utiles pour le d\u00e9veloppement car vous pouvez monter votre code source directement dans un conteneur.<\/strong>: During development, bind mounts can significantly speed up your workflow by allowing real-time changes to your code. Just be aware of the potential for differences between your development and production environments.<\/p>\n<\/li>\n<li>\n<p><strong>Backup and Restore Volumes<\/strong>: Regularly back up your volumes, especially those holding critical data. You can use the <code>docker cp<\/code> command or other backup tools to create snapshots of your volumes.<\/p>\n<\/li>\n<li>\n<p><strong>Clean Up Unused Volumes<\/strong>: Docker peut accumuler des volumes inutilis\u00e9s au fil du temps, ce qui entra\u00eene un gaspillage d'espace disque. Utilisez la commande <code><span class=\"glossaryai-tooltip glossary-term-1172\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-volume-prune\/\" target=\"_blank\">docker volume nettoyer<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Volume Prune est une commande utilis\u00e9e pour supprimer tous les volumes inutilis\u00e9s de votre syst\u00e8me. Cela permet de g\u00e9rer l'espace disque efficacement en \u00e9liminant les donn\u00e9es orphelines qui ne sont plus associ\u00e9es \u00e0 aucun conteneur.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-volume-prune\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code> pour supprimer tous les volumes inutilis\u00e9s en toute s\u00e9curit\u00e9.<\/p>\n<\/li>\n<li>\n<p><strong>Configurations de contr\u00f4le de version<\/strong>: For files that you <span class=\"glossaryai-tooltip glossary-term-700\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/bind-mount\/\" target=\"_blank\">bind mount<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A bind mount is a method in Linux that allows a directory to be mounted at multiple locations in the filesystem. This enables flexible file access without duplicating data, enhancing resource management.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/bind-mount\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> (like configuration files), consider keeping these files in version control. This helps maintain consistency across environments and ensures that changes are tracked.<\/p>\n<\/li>\n<\/ol>\n<h2>Gestion avanc\u00e9e des volumes<\/h2>\n<h3>Pilotes de volume<\/h3>\n<p>Docker supports various <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\" target=\"_blank\">volume<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> drivers that extend the capabilities of volumes. These drivers can allow you to store volumes on external storage systems, cloud storage, or manage volumes in a more sophisticated way. For instance, you can use drivers for Amazon EBS, NFS, or Ceph.<\/p>\n<p>Example:<\/p>\n<pre><code class=\"language-yaml\">volumes:\n  my_aws_volume:\n    driver: local\n    driver_opts:\n      type: nfs\n      o: adresse=aws_address,rw\n      p\u00e9riph\u00e9rique: \":\/path\/to\/nfs\"<\/code><\/pre>\n<h3>Options de volume<\/h3>\n<p>When creating volumes, you may need to specify additional options. For example, you might need to set access modes or configure specific <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\" target=\"_blank\">volume<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> drivers. Always refer to the Docker documentation to understand the available options for your specific use case.<\/p>\n<h3>Surveillance et d\u00e9pannage des volumes<\/h3>\n<p>Monitoring the performance and health of your volumes is crucial to ensure your applications <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> smoothly. You can use Docker\u2019s built-in commands such as <code><span class=\"glossaryai-tooltip glossary-term-1171\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-volume-ls\/\" target=\"_blank\">docker volume ls<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">The `docker volume ls` command lists all Docker volumes on the host. This command helps users to manage persistent data storage efficiently, providing essential details like volume name and driver.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-volume-ls\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code> and <code><span class=\"glossaryai-tooltip glossary-term-1169\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-volume-inspect\/\" target=\"_blank\">docker volume inspect<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Volume Inspect est une commande utilis\u00e9e pour r\u00e9cup\u00e9rer des informations d\u00e9taill\u00e9es sur des volumes sp\u00e9cifiques dans un environnement Docker. Elle fournit des m\u00e9tadonn\u00e9es telles que le point de montage, le pilote et les options, facilitant la gestion efficace des volumes.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-volume-inspect\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code> pour recueillir des informations sur vos volumes. Pour les configurations complexes, envisagez d'utiliser des outils de surveillance comme Prometheus ou Grafana pour garder un \u0153il sur les performances de stockage et les m\u00e9triques d'utilisation.<\/p>\n<h2>Conclusion<\/h2>\n<p>In summary, the <code>--volumes<\/code> option in <span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose is a tool for defining and running multi-container Docker applications using a YAML file. It simplifies deployment, configuration, and orchestration of services, enhancing development efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> is a vital feature that allows developers to manage data persistence and sharing effectively across multiple containers. Understanding the various types of volumes, their syntax, and best practices can significantly enhance your ability to build robust Docker applications. By leveraging named volumes, bind mounts, and advanced <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\" target=\"_blank\">volume<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> management techniques, developers can create scalable, maintainable, and efficient solutions tailored to their specific needs. As you continue to explore Docker and <span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose is a tool for defining and running multi-container Docker applications using a YAML file. It simplifies deployment, configuration, and orchestration of services, enhancing development efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, remember that effective <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\" target=\"_blank\">volume<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> management is key to ensuring the longevity and reliability of your applications.<\/p>","protected":false},"excerpt":{"rendered":"<p>Docker Compose\u2019s `volumes` configuration allows developers to manage persistent data easily across containerized applications. By defining volumes, users ensure data retention beyond <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\" target=\"_blank\">conteneur<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/fr\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> lifecycle, enhancing data integrity and portability.<\/p>","protected":false},"author":1,"featured_media":1923,"parent":0,"template":"","glossary-cat":[],"class_list":["post-1303","glossary","type-glossary","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Docker Compose Config -volumes - Dockerpros<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dockerpros.com\/fr\/wiki\/volumes\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Docker Compose Config -volumes - Dockerpros\" \/>\n<meta property=\"og:description\" content=\"Docker Compose&#039;s `volumes` configuration allows developers to manage persistent data easily across containerized applications. By defining volumes, users ensure data retention beyond container lifecycle, enhancing data integrity and portability.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dockerpros.com\/fr\/wiki\/volumes\/\" \/>\n<meta property=\"og:site_name\" content=\"Dockerpros\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-23T12:22:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-compose-config-volumes_1303.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data1\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/docker-compose-config-volumes\/\",\"url\":\"https:\/\/dockerpros.com\/wiki\/docker-compose-config-volumes\/\",\"name\":\"Docker Compose Config -volumes - Dockerpros\",\"isPartOf\":{\"@id\":\"https:\/\/dockerpros.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/docker-compose-config-volumes\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/docker-compose-config-volumes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-compose-config-volumes_1303.jpg\",\"datePublished\":\"2024-07-23T12:19:48+00:00\",\"dateModified\":\"2024-07-23T12:22:52+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/dockerpros.com\/wiki\/docker-compose-config-volumes\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dockerpros.com\/wiki\/docker-compose-config-volumes\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/docker-compose-config-volumes\/#primaryimage\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-compose-config-volumes_1303.jpg\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-compose-config-volumes_1303.jpg\",\"width\":800,\"height\":600,\"caption\":\"docker-compose-config-volumes-2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dockerpros.com\/wiki\/docker-compose-config-volumes\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/dockerpros.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Glossary\",\"item\":\"https:\/\/dockerpros.com\/fr\/wiki\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Docker Compose Config &#8211;volumes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dockerpros.com\/#website\",\"url\":\"https:\/\/dockerpros.com\/\",\"name\":\"Dockerpros\",\"description\":\"DockerPros \u2013 Your Ultimate Docker Resource Hub\",\"publisher\":{\"@id\":\"https:\/\/dockerpros.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dockerpros.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/dockerpros.com\/#organization\",\"name\":\"Dockerpros\",\"url\":\"https:\/\/dockerpros.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png\",\"width\":532,\"height\":114,\"caption\":\"Dockerpros\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Configuration Docker Compose - volumes - Dockerpros","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dockerpros.com\/fr\/wiki\/volumes\/","og_locale":"fr_FR","og_type":"article","og_title":"Docker Compose Config -volumes - Dockerpros","og_description":"Docker Compose's `volumes` configuration allows developers to manage persistent data easily across containerized applications. By defining volumes, users ensure data retention beyond container lifecycle, enhancing data integrity and portability.","og_url":"https:\/\/dockerpros.com\/fr\/wiki\/volumes\/","og_site_name":"Dockerpros","article_modified_time":"2024-07-23T12:22:52+00:00","og_image":[{"width":800,"height":600,"url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-compose-config-volumes_1303.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Dur\u00e9e de lecture estim\u00e9e":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/dockerpros.com\/wiki\/docker-compose-config-volumes\/","url":"https:\/\/dockerpros.com\/wiki\/docker-compose-config-volumes\/","name":"Configuration Docker Compose - volumes - Dockerpros","isPartOf":{"@id":"https:\/\/dockerpros.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dockerpros.com\/wiki\/docker-compose-config-volumes\/#primaryimage"},"image":{"@id":"https:\/\/dockerpros.com\/wiki\/docker-compose-config-volumes\/#primaryimage"},"thumbnailUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-compose-config-volumes_1303.jpg","datePublished":"2024-07-23T12:19:48+00:00","dateModified":"2024-07-23T12:22:52+00:00","breadcrumb":{"@id":"https:\/\/dockerpros.com\/wiki\/docker-compose-config-volumes\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dockerpros.com\/wiki\/docker-compose-config-volumes\/"]}]},{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/dockerpros.com\/wiki\/docker-compose-config-volumes\/#primaryimage","url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-compose-config-volumes_1303.jpg","contentUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/docker-compose-config-volumes_1303.jpg","width":800,"height":600,"caption":"docker-compose-config-volumes-2"},{"@type":"BreadcrumbList","@id":"https:\/\/dockerpros.com\/wiki\/docker-compose-config-volumes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dockerpros.com\/"},{"@type":"ListItem","position":2,"name":"Glossary","item":"https:\/\/dockerpros.com\/fr\/wiki\/"},{"@type":"ListItem","position":3,"name":"Docker Compose Config &#8211;volumes"}]},{"@type":"WebSite","@id":"https:\/\/dockerpros.com\/#website","url":"https:\/\/dockerpros.com\/","name":"Dockerpros","description":"DockerPros \u2013 Votre centre de ressources Docker incontournable","publisher":{"@id":"https:\/\/dockerpros.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dockerpros.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/dockerpros.com\/#organization","name":"Dockerpros","url":"https:\/\/dockerpros.com\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/","url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png","contentUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png","width":532,"height":114,"caption":"Dockerpros"},"image":{"@id":"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/glossary\/1303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/glossary"}],"about":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/types\/glossary"}],"author":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":0,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/glossary\/1303\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/media\/1923"}],"wp:attachment":[{"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/media?parent=1303"}],"wp:term":[{"taxonomy":"glossary-cat","embeddable":true,"href":"https:\/\/dockerpros.com\/fr\/wp-json\/wp\/v2\/glossary-cat?post=1303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}