{"id":15043075,"url":"https://github.com/funkwerk/compose_format","last_synced_at":"2025-04-14T20:31:10.999Z","repository":{"id":62564230,"uuid":"53572304","full_name":"funkwerk/compose_format","owner":"funkwerk","description":"format docker compose files using recipes from best practices","archived":false,"fork":false,"pushed_at":"2020-01-05T10:35:42.000Z","size":33,"stargazers_count":45,"open_issues_count":9,"forks_count":19,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T09:01:40.054Z","etag":null,"topics":["compose","docker","docker-compose","format"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/funkwerk.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2016-03-10T09:32:09.000Z","updated_at":"2025-01-05T18:12:33.000Z","dependencies_parsed_at":"2022-11-03T16:45:38.295Z","dependency_job_id":null,"html_url":"https://github.com/funkwerk/compose_format","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkwerk%2Fcompose_format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkwerk%2Fcompose_format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkwerk%2Fcompose_format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkwerk%2Fcompose_format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funkwerk","download_url":"https://codeload.github.com/funkwerk/compose_format/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248955481,"owners_count":21189126,"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","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":["compose","docker","docker-compose","format"],"created_at":"2024-09-24T20:48:32.394Z","updated_at":"2025-04-14T20:31:10.629Z","avatar_url":"https://github.com/funkwerk.png","language":"Python","readme":"[![Build Status](https://travis-ci.org/funkwerk/compose_format.svg)](https://travis-ci.org/funkwerk/compose_format)\n[![](https://badge.imagelayers.io/funkwerk/compose_format.svg)](https://imagelayers.io/?images=funkwerk/compose_format:latest 'funkwerk/compose_format')\n[![Docker Build](https://img.shields.io/docker/automated/funkwerk/compose_format.svg)](https://hub.docker.com/r/funkwerk/compose_format/)\n[![PyPi version](https://img.shields.io/pypi/v/compose_format.svg)](https://pypi.python.org/pypi/compose_format/)\n[![Docker pulls](https://img.shields.io/docker/pulls/funkwerk/compose_format.svg)](https://hub.docker.com/r/funkwerk/compose_format/)\n\n# compose_format\n\nFormats docker-compose files by using the distilled docker compose best practices.\n\n## Docker Compose Files are complex\n\nDocker Compose Files could be rather complex.\nIf these files are complex, there are multiple ways to write the same thing.\nIf there are multiple ways to format these files, these multiple ways will be used.\nMeans that it will be not possible to diff your files, cause everybody writes them a bit different.\n\n## Alphabetical order vs. custom order\n\nSorting would be easy, if everything could be sorted alphabetically.\nBut in compose files the first thing mentioned for a service is the `image`.\n`compose_format` aims to distill these compose format best practices into a tool.\n\n## Comments\n\nUsually formatting tools destroy comments. But comments contain valueable TODO-markers or other hints.\n`compose_format` putted effort into supporting comments.\n\n## Support\n\nNote that this small utility is just valid until docker-compose has itself a format functionality.\nCurrently docker-compose just support the \"config\" switch. Which joins multiple compose files and print them in a machine-readable form.\n\n## Usage\n\n### Via Python\n\nInstall it via:\n`pip3 install compose_format`\n\nAfter that use it like\n\n`compose_format compose-format.yml`\nthis will print the formatted compose file to stdout.\nTo let it replace the compose file add `--replace`.\n\n### Via Docker\n\nUse it like:\n`cat docker-compose.yml | docker run -i funkwerk/compose_format`\n\n## Features\n - Support for Version 3, 2.1, 2, and 1.\n - Support for Comments\n - Orders Services, Volumes, Networks\n - Orders Definitions\n - Orders Port and Volume Lists\n\n## Contribution\n\nFeel free to add issues or provide Pull Requests.\nEspecially when the order in some points violates the best practices.\nThis tool should be changed based on the evolving best practices.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunkwerk%2Fcompose_format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunkwerk%2Fcompose_format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunkwerk%2Fcompose_format/lists"}