{"id":15227824,"url":"https://github.com/maxlareo/maxlareo-docker_compose","last_synced_at":"2025-10-21T01:11:18.389Z","repository":{"id":57664180,"uuid":"90034341","full_name":"maxlareo/maxlareo-docker_compose","owner":"maxlareo","description":"Puppet module to install, set and manage Docker Compose","archived":true,"fork":false,"pushed_at":"2017-05-02T17:49:03.000Z","size":31,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-21T10:39:02.786Z","etag":null,"topics":["docker","docker-compose","puppet","puppet-module"],"latest_commit_sha":null,"homepage":"https://forge.puppet.com/maxlareo/docker_compose","language":"Puppet","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxlareo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-02T13:05:11.000Z","updated_at":"2023-01-26T22:12:04.000Z","dependencies_parsed_at":"2022-09-10T08:40:51.597Z","dependency_job_id":null,"html_url":"https://github.com/maxlareo/maxlareo-docker_compose","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/maxlareo/maxlareo-docker_compose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlareo%2Fmaxlareo-docker_compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlareo%2Fmaxlareo-docker_compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlareo%2Fmaxlareo-docker_compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlareo%2Fmaxlareo-docker_compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxlareo","download_url":"https://codeload.github.com/maxlareo/maxlareo-docker_compose/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlareo%2Fmaxlareo-docker_compose/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278267482,"owners_count":25958873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","puppet","puppet-module"],"created_at":"2024-09-28T23:06:06.646Z","updated_at":"2025-10-04T05:31:34.570Z","avatar_url":"https://github.com/maxlareo.png","language":"Puppet","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker_compose\n\n#### Table of Contents\n\n1. [Overview](#overview)\n2. [Module Description - What the module does and why it is useful](#module-description)\n3. [Setup - The basics of getting started with docker_compose](#setup)\n    * [What docker_compose affects](#what-docker_compose-affects)\n    * [Setup requirements](#setup-requirements)\n    * [Beginning with docker_compose](#beginning-with-docker_compose)\n4. [Usage - Configuration options and additional functionality](#usage)\n5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)\n5. [Limitations - OS compatibility, etc.](#limitations)\n6. [Development - Guide for contributing to the module](#development)\n\n## Overview\n\nA Puppet module to install and set [Docker Compose](https://docs.docker.com/compose/overview/)\nfiles and manage Docker containers through Docker Compose commands.\n\n### Support\n\nThis module is currently tested on:\n\n* Debian Jessie\n\n## Module Description\n\nThe docker_compose manage Docker Compose Files and Docker containers through them.\n\nThis module generate docker-compose.yml files conform to the official\n[Docker Documentation](https://docs.docker.com/compose/compose-file/).\n\n## Setup\n\n### What docker_compose affects\n\n* Curl present to download Docker Compose binary.\n* Docker Compose binary installed on the node.\n* Docker Compose files in `${name}/docker-compose.yml`.\n\n### Setup Requirements\n\nThis module requires Docker to be installed and running.\nIt also require [puppetlabs-stdlib](https://github.com/puppetlabs/puppetlabs-stdlib).\n\n### Beginning with docker_compose\n\n#### Install Docker Compose\n\n```puppet\nclass { 'docker_compose': }\n```\n\nIf using Hiera\n```yaml\n---\nclasses:\n  - docker_compose\n```\n\n#### Docker Compose example\n\n```puppet\ndocker_compose::compose { '/opt':\n  version  =\u003e '2',\n  services =\u003e {\n    'hello-world' =\u003e {\n      image =\u003e 'hello-world'\n    },\n  },\n}\n```\n\nIf using Hiera\n```yaml\ndocker_compose::compose:\n  '/opt':\n    version: '2'\n    services:\n      hello-world:\n        image: hello-world\n```\n\nOn the node, in the '/opt' folder, try `docker-compose run hello-world` to test it.\n\n## Usage\n\nTo declare a docker-compose file, use the docker_compose::compose resource.\nThis resource use nested Hashes to describe each docker-compose.yml files.\n\nThe first Hash layer use the key as the path of the docker-compose file.\nThe option `version` is mandatory and describe the docker compose syntax version.\nThe rest is optional and try to follow the\n[Docker Documentation](https://docs.docker.com/compose/compose-file/)\nsyntax, using four options: services, volumes, networks and secrets.\n\nA service definition contains configuration which will be applied to each container\nstarted for that service, much like passing command-line parameters to docker run.\nLikewise, network and volume definitions are analogous to docker network create and\ndocker volume create.\n\nSecrets configuration are availble from Docker Compose version 3 and grant access to\nsecrets on a per-service basis using the per-service secrets.\n\n### Example of bare minimum to create a Docker Compose file\n\nFor a file to be created, only the hash key and the version has to be setted.\n\nCreate a docker-compose.yml file in '/opt':\n```puppet\ndocker_compose::compose { '/opt':\n  version  =\u003e '2',\n}\n```\nIf using Hiera\n```yaml\ndocker_compose::compose:\n  '/opt':\n    version: '2'\n```\n\n### Declare services / volumes / networks / secrets\n\nServices, Volumes, Networks and Secrets are declared into a Hash,\nfollowing the Docker Compose file syntax.\n\nDeclarations example of some services:\n```puppet\ndocker_compose::compose { '/opt':\n  version  =\u003e '2',\n  services =\u003e {\n    'nginx' =\u003e {\n      image =\u003e 'nginx:latest',\n      container_name: 'nginx'\n    },\n    'mariadb' =\u003e {\n      image =\u003e 'mariadb'\n    },\n  },\n}\n```\n\nIf using Hiera\n```yaml\ndocker_compose::compose:\n  '/opt':\n    version: '2'\n      services:\n        nginx:\n          image: nginx\n          container_name: nginx\n        mariadb:\n          image: mariadb\n```\n\n### Full Example\n\nHere is a full example of docker-compose file declarations with this module:\n```puppet\ndocker_compose::compose { '/opt':\n  version  =\u003e '2',\n  services =\u003e {\n    nginx =\u003e {\n      image =\u003e 'nginx:latest',\n      container_name =\u003e 'nginx',\n      networks =\u003e [ 'net-1' ],\n      ports =\u003e [ '80:80','443:443' ],\n      volumes =\u003e [ 'web:/var/www/html' ]\n    },\n    mariadb =\u003e {\n      image =\u003e 'mariadb'\n    },\n  },\n  volumes =\u003e {\n    web =\u003e {},\n  },\n  networks =\u003e {\n    net-1 =\u003e {\n      ipam =\u003e {\n        config =\u003e [\n          { subnet =\u003e '172.50.1.0/24' }\n        ],\n      }\n    },\n  },\n}\n```\n\nIf using Hiera\n```yaml\ndocker_compose::compose:\n  '/opt':\n    version: '2'\n    services:\n      nginx:\n        image: 'nginx'\n        container_name: 'nginx'\n        networks:\n          - 'net-1'\n        ports:\n          - '80:80'\n          - '443:443'\n        volumes:\n          - 'web:/var/www/html'\n      mariadb:\n        image: 'mariadb'\n    volumes:\n      web:\n    networks:\n      net-1:\n        ipam:\n          config:\n            - subnet: '172.50.2.0/24'\n```\n\n## Reference\n\n### Public Class\n\n* docker_compose\n\n### Private Class\n\n* docker_compose::install\n* docker_compose::params\n\n### Define\n\n* docker_compose::compose\n\n#### Class `docker_compose`\n\nParameters\n\n* version\nThe version of Docker Compose to be installed.\nString. Default: 1.8.1\n\n* docker_compose_path\nThe docker-compose binary full path.\nString. Default: /usr/local/bin\n\n#### Define `docker_compose::compose`\n\nParameters\n\n* version\nThe docker-compose syntax version use into the file.\nString. Default: 2\n\n* owner\nThe owner of the docker-compose file.\nString. Default: root\n\n* group\nThe group of owner the docker-compose file.\nString. Default: root\n\n* ensure\nThe puppet ensure state of the docker-compose file.\nString. Default: present\n\n* services\nThe docker services describe into the docker-compose file.\nHash. Default: undef\n\n* volumes\nThe docker volumes describe into the docker-compose file.\nHash. Default: undef\n\n* networks\nThe docker networks describe into the docker-compose file.\nHash. Default: undef\n\n* secrets\nThe docker secrets describe into the docker-compose file.\nHash. Default: undef\n\n## Limitations\n\nThis module is tested on Debian 8 and should work on every\nDebian based distribution.\n\nFor now only installation and files creation and management of\nDocker Compose are supported.\n\nFurther functionalities to come:\n\n* management of docker containers through docker-compose commands.\nFor example, maintain \"docker-compose up -d\" or set \"docker-compose down\".\n* possibility to auto pull docker containers from docker-compose via cron.\nTo maintain latest docker images running.\n\n## Development\n\nContributions will be gratefully accepted. Please go to the project page, fork\nthe project, make your changes locally and then raise a pull request.\nDetails on how to do this are available at https://guides.github.com/activities/forking.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxlareo%2Fmaxlareo-docker_compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxlareo%2Fmaxlareo-docker_compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxlareo%2Fmaxlareo-docker_compose/lists"}