{"id":13415879,"url":"https://github.com/composerize/composerize","last_synced_at":"2025-05-13T23:08:57.926Z","repository":{"id":38991376,"uuid":"66609310","full_name":"composerize/composerize","owner":"composerize","description":"🏃→🎼  docker run asdlksjfksdf \u003e docker-composerize up","archived":false,"fork":false,"pushed_at":"2025-05-08T08:08:35.000Z","size":5154,"stargazers_count":3439,"open_issues_count":11,"forks_count":232,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-05-08T09:23:36.115Z","etag":null,"topics":["docker","docker-compose","dockerfile"],"latest_commit_sha":null,"homepage":"http://composerize.com","language":"JavaScript","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/composerize.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,"zenodo":null}},"created_at":"2016-08-26T02:20:37.000Z","updated_at":"2025-05-08T08:08:39.000Z","dependencies_parsed_at":"2023-02-05T02:02:07.436Z","dependency_job_id":"f4f44db7-4336-44c2-8848-c591fd03a439","html_url":"https://github.com/composerize/composerize","commit_stats":{"total_commits":215,"total_committers":13,"mean_commits":16.53846153846154,"dds":0.5534883720930233,"last_synced_commit":"10e1b3be531f6d3d6b8e8153fe35d33e5f66cc70"},"previous_names":["composerize/composerize","magicmark/composerize"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composerize%2Fcomposerize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composerize%2Fcomposerize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composerize%2Fcomposerize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composerize%2Fcomposerize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/composerize","download_url":"https://codeload.github.com/composerize/composerize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254041905,"owners_count":22004800,"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","dockerfile"],"created_at":"2024-07-30T21:00:52.729Z","updated_at":"2025-05-13T23:08:52.909Z","avatar_url":"https://github.com/composerize.png","language":"JavaScript","readme":"# composerize\n\n[![Build Status](https://travis-ci.org/magicmark/composerize.svg?branch=master)](https://travis-ci.com/github/magicmark/composerize)\n[![npm](https://img.shields.io/npm/v/composerize.svg)](https://www.npmjs.com/package/composerize)\n[![Follow @mark_larah](https://img.shields.io/twitter/follow/mark_larah)](https://twitter.com/mark_larah?ref_src=github_composerize)\n[![ShareVB on GitHub](https://img.shields.io/badge/ShareVB-100000?logo=github\u0026logoColor=white)](https://github.com/sharevb)\n            \nhttp://composerize.com - Turns `docker run` commands into `compose.yaml` files and even merge with existing `compose.yaml`!\n\nLooking for the reverse : http://decomposerize.com / [Decomposerize](https://github.com/outilslibre/decomposerize)\n\nWant to convert from Docker compose file formats : http://composeverter.com / [Composeverter](https://github.com/outilslibre/composeverter)\n\n![Demo](https://i.imgur.com/GayZj2G.png)\n\n## CLI\n\ncomposerize can be run in the cli.\n\n`npm install composerize -g` to install, and run as such:\n\n```bash\n$ composerize docker run -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro --restart always --log-opt max-size=1g nginx\n```\n\nSee `composerize --help` for more options.\n\n## Docker image\n\nA dockker image of composerize, decomposerize and composeverter websites is available here: https://github.com/Oaklight/composerize-minimal/blob/master/README_en.md (thanks to @Oaklight)\n\n## How to use with node.js\n\nMake sure to install the `composerize` package in your project by running:\n\n```bash\nnpm install composerize\n```\n\nWith the following code, you can easily integrate **Composerize** into your Node.js project and generate Docker Compose configurations from Docker run commands.\n\n```javascript\nconst composerize = require('composerize');\n\nconst dockerRunCommand = 'docker run -d -p 8080:80 --name my-web-app nginx:latest';\n\n// Convert the Docker run command to a Docker Compose configuration\nconst composeConfig = composerize(dockerRunCommand);\n\nconsole.log(composeConfig);\n```\n\nYou can also merge docker run command(s) with an existing Docker Compose file content :\n\n```javascript\nconst composerize = require('composerize');\n\nconst dockerRunCommand = 'docker run -d -p 8080:80 --name my-web-app nginx:latest';\n\n// An existing Docker Compose configuration as a string\nconst existingComposeConfig = `\nversion: '3'\nservices:\n  existing-service:\n    image: my-existing-image:latest\n    ports:\n      - '8000:80'\n`;\n\n// Convert the Docker run command to a Docker Compose configuration and merge with provided docker compose\nconst composeConfig = composerize(dockerRunCommand, existingComposeConfig);\n\nconsole.log(composeConfig);\n```\n\nYou can also choose which version of Docker compose V2, you target : 2.x, 3.x or Common Specification by specifying a third parameter `composeVersion` on `convertDockerRunToCompose` :\n- 'v2x'\n- 'v3x'\n- 'latest'\n\n```javascript\nconst composerize = require('composerize');\n\nconst dockerRunCommand = 'docker run -d -p 8080:80 --name my-web-app nginx:latest';\n\n// Convert the Docker run command to a Docker Compose configuration for 2.x\nconst composeConfig = composerize(dockerRunCommand, null, 'v2x');\n\nconsole.log(composeConfig);\n```\n\nYou can also choose indentation level by specifying a fourth parameter `indent` on `convertDockerRunToCompose` :\n- 'v2x'\n- 'v3x'\n- 'latest'\n\n```javascript\nconst composerize = require('composerize');\n\nconst dockerRunCommand = 'docker run -d -p 8080:80 --name my-web-app nginx:latest';\n\n// Convert the Docker run command to a Docker Compose configuration for 2.x\nconst composeConfig = composerize(dockerRunCommand, null, 'latest', 2);\n\nconsole.log(composeConfig);\n```\n\n## Contributing\n\n- [Clone a fork of the repo](https://guides.github.com/activities/forking/) and install the project dependencies by running `yarn`\n- Make your changes, and build the project by running `make build`\n- Test your changes with `make test`\n\n## Maintainers\n\n- Mark Larah (Twitter: [@mark_larah](https://twitter.com/mark_larah))\n- ShareVB [GitHub](https://github.com/sharevb)\n","funding_links":[],"categories":["Container Operations","JavaScript","HarmonyOS","docker","docker-compose"],"sub_categories":["Container Composition","Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomposerize%2Fcomposerize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomposerize%2Fcomposerize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomposerize%2Fcomposerize/lists"}