{"id":36549479,"url":"https://github.com/omarahm3/compat","last_synced_at":"2026-01-12T06:31:01.630Z","repository":{"id":59044962,"uuid":"528942269","full_name":"omarahm3/compat","owner":"omarahm3","description":"Share docker-compose configuration between services","archived":false,"fork":false,"pushed_at":"2022-09-22T10:01:27.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-15T00:50:13.325Z","etag":null,"topics":["docker","docker-compose","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/omarahm3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-25T16:58:50.000Z","updated_at":"2022-08-25T20:49:55.000Z","dependencies_parsed_at":"2023-01-18T23:15:17.595Z","dependency_job_id":null,"html_url":"https://github.com/omarahm3/compat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/omarahm3/compat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omarahm3%2Fcompat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omarahm3%2Fcompat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omarahm3%2Fcompat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omarahm3%2Fcompat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omarahm3","download_url":"https://codeload.github.com/omarahm3/compat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omarahm3%2Fcompat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28336316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","yaml"],"created_at":"2026-01-12T06:31:00.793Z","updated_at":"2026-01-12T06:31:01.625Z","avatar_url":"https://github.com/omarahm3.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compat\n\nHave you ever wondered why there is no inheritance on docker-compose yaml syntax? and why am i writing the same stuff again and again for some services? well .. i had the same questions, and i couldn't find any solution for it, that is why i created this small tool to allow reusability on docker-compose files.\n\nIt is so simple as doing:\n\n```\nfile: compat.yaml\nversion: '3.2'\nservices:\n  base_service:\n    deploy:\n      resources:\n        limits:\n          cpus: '0.1'\n          memory: 128M\n        reservations:\n          memory: 128M\n\n  mongo:\n    inherit: base_service\n    container_name: database\n    image: mongo\n```\n\nthat will get converted into:\n\n```\nfile: docker-compose.yaml\nversion: '3.2'\nservices:\n  mongo:\n    container_name: database\n    deploy:\n      resources:\n        limits:\n          cpus: '0.1'\n          memory: 128M\n        reservations:\n          memory: 128M\n    image: mongo\n```\n\nOr check [./example](./example) to know how to inherit multiple services.\n\n## Why not `extends` though?\n\nIt depends on the use case, to use [extends](https://docs.docker.com/compose/extends) you must have a common \"service\" not \"configuration\" while for `inherit` you're just sharing configuration on whatever services.\n\n## How?\n\nCompat depends on a new file `compat.yaml` that is in the exact same syntax as `docker-compose.yaml` for only single purpose which is to allow the use of `compat` service property.\nRunning `compat` will actually parse the file by looking for `inherit` and for any `base_*` services, will reuse whatever under `base_*` and add them to services.\n\n## Install\n\nIf you already have golang installed:\n\n```\ngo install github.com/omarahm3/compat@latest\n```\n\n## TODO\n\n- [X] Tests\n- [X] Allow multiple inheritance?\n- [ ] Add release workflow for automated releases\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomarahm3%2Fcompat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomarahm3%2Fcompat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomarahm3%2Fcompat/lists"}