{"id":20271705,"url":"https://github.com/macropygia/dc-multiple-project-makefile","last_synced_at":"2025-08-10T23:42:13.965Z","repository":{"id":132813687,"uuid":"343830023","full_name":"macropygia/dc-multiple-project-makefile","owner":"macropygia","description":"Makefile for handle multiple docker-compose projects based on a directory structure and some files.","archived":false,"fork":false,"pushed_at":"2023-02-04T16:21:44.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-14T05:49:41.391Z","etag":null,"topics":["docker","docker-compose","make","makefile"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":false,"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/macropygia.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-02T15:58:49.000Z","updated_at":"2023-02-04T16:18:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"a05a186c-60ea-4bdb-90b2-3b3a828941e9","html_url":"https://github.com/macropygia/dc-multiple-project-makefile","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macropygia%2Fdc-multiple-project-makefile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macropygia%2Fdc-multiple-project-makefile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macropygia%2Fdc-multiple-project-makefile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macropygia%2Fdc-multiple-project-makefile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/macropygia","download_url":"https://codeload.github.com/macropygia/dc-multiple-project-makefile/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241758964,"owners_count":20015251,"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":["docker","docker-compose","make","makefile"],"created_at":"2024-11-14T12:39:09.168Z","updated_at":"2025-03-04T00:05:04.263Z","avatar_url":"https://github.com/macropygia.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dc-multiple-project-makefile\n\nMakefile for handle multiple docker-compose projects based on a directory structure and some files.\n\n![animation](https://user-images.githubusercontent.com/3162324/109684613-ca6e5680-7bc3-11eb-9837-7cf63bca2a9d.gif)\n\n## Typical structure\n\n```text\n.\n|-- Makefile\n|-- preset.mk\n|-- gitlab\n|   |-- .env\n|   |-- .desc\n|   `-- docker-compose.yml\n|-- pgadmin\n|   |-- .env\n|   |-- .alias\n|   |-- .desc\n|   `-- docker-compose.yml\n|-- postgres\n|   |-- .env\n|   |-- .alias\n|   |-- .desc\n|   |-- docker-compose.yml\n|   `-- init\n|       `-- init_gitlab.sh\n`-- redis\n    |-- .env\n    |-- .desc\n    `-- docker-compose.yml\n```\n\n## Usage\n\n```bash\n$ make [dirname|alias|preset]... [command]\n```\n\nor\n\n```bash\n$ make [command]\n```\n\n## Commands\n\n### Use with dirname/alias/preset\n\n- `up`, `upf`, `build`, `pull`, `down`, `start`, `stop`, `restart`, `pause`, `unpause`, `ps`, `logs`, `logsf`, `logs\u003cint\u003e`, `logsf\u003cint\u003e`, `top`\n    - `up` executes `up -d` .\n    - `upf` executes `up` .\n    - `logsf` executes `logs -f` .\n    - `logs\u003cint\u003e` executes `logs -n \u003cint\u003e` .\n    - `logsf\u003cint\u003e` executes `logs -f -n \u003cint\u003e` .\n- `do cmd=\"[any docker compose command]\"`\n- `info`\n    - Show directory name and description.\n\n### Use independently\n\n- `active`\n    - Same as `$ make all ps | grep Up`.\n- `ls`\n    - Show the directory name, alias, and description of all projects.\n- `clean`\n    - Remove `.dc_history` and `.dc_latest`.\n\n### Tips\n\nTargets are executed sequentially. (Ref: [GNU Make](https://www.gnu.org/software/make/))\n\nSo...\n\n```bash\n$ make proj1 down proj2 pull proj3 up\n```\n\nThis works as follows:\n\n1. Add `proj1` to the processing target\n2. Execute `down` to `proj1`\n3. Add `proj2` to the processing target\n4. Execute `pull` to `proj1 \u0026 2`\n5. Add `proj3` to the processing target\n6. Execute `up -d` to `proj1 \u0026 2 \u0026 3`\n\n## Preset\n\nDefine at the `preset.mk`.\n\n```Makefile\n.PHONY: preset_name\npreset_name: [dirname|alias|preset|command]...\n```\n\n### Example\n\n```Makefile\n.PHONY: preset1 preset2 preset3\npreset1: proj1 proj3 proj5\npreset2: proj2 proj3\npreset3: preset1 preset2\n```\n\n`preset3` means `proj1 proj3 proj5 proj2`.\n\n### Built-in preset\n\n- `all`\n    - All projects.\n- `latest`\n    - The project(s) that was operated last time. (Written in `.dc_latest`)\n\n## Files\n\n### `./*/docker-compose.yml`\n\nThe directory containing `docker-compose.yml` will detect as the docker compose project.\n\n### `./*/.env` (Optional)\n\nStrongly recommended setting the project name using `COMPOSE_PROJECT_NAME`.\n\n### `./*/.desc` (Optional)\n\nWrite a short description used in `ls` and `info` commands.\n\n### `./*/.alias` (Optional)\n\nWrite a short name that can use as an alternative to the directory name.\n\n### `./preset.mk` (Optional)\n\nTo define presets.\n\n### `./.dc_latest`\n\nA temporary file to record the current project being operated.\n\n### `./.dc_history`\n\nLog of executed commands except for `ps` , `logs` , `logsf` and `top`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacropygia%2Fdc-multiple-project-makefile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmacropygia%2Fdc-multiple-project-makefile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacropygia%2Fdc-multiple-project-makefile/lists"}