{"id":27881843,"url":"https://github.com/src-d/go-compose-installer","last_synced_at":"2025-05-05T05:05:42.947Z","repository":{"id":79453994,"uuid":"111685829","full_name":"src-d/go-compose-installer","owner":"src-d","description":"A toolkit to create installers based on docker compose.","archived":false,"fork":false,"pushed_at":"2018-01-25T11:08:28.000Z","size":4643,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-05T05:05:36.585Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/src-d.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":"2017-11-22T13:11:23.000Z","updated_at":"2021-12-22T17:08:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"6a196bb4-b43b-4f2e-bc5e-2e7438b2c4f9","html_url":"https://github.com/src-d/go-compose-installer","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/src-d%2Fgo-compose-installer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Fgo-compose-installer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Fgo-compose-installer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Fgo-compose-installer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/src-d","download_url":"https://codeload.github.com/src-d/go-compose-installer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252442486,"owners_count":21748451,"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":[],"created_at":"2025-05-05T05:05:42.472Z","updated_at":"2025-05-05T05:05:42.940Z","avatar_url":"https://github.com/src-d.png","language":"Go","readme":"\n# go-compose-installer [![GoDoc](https://godoc.org/github.com/src-d/go-compose-installer?status.svg)](https://godoc.org/github.com/src-d/go-compose-installer)\n\nA toolkit to create installers based on docker compose.\n\n*go-compose-installer* allows to deploy complex infrastructure applications using a single binary, with no more dependencies than `docker`.\n\n## Example\n\nThis is an example based on the [docker compose tutorial](https://docs.docker.com/compose/gettingstarted/#where-to-go-next), this example installs a basic environment based on a web server backed by a redis service.\n\n```go\npackage main\n\nimport (\n\t\"github.com/src-d/go-compose-installer\"\n)\n\nfunc main() {\n\t// New default Config, containing a suite of standard messages to be\n\t// printed at every operation.\n\tcfg := installer.NewDefaultConfig()\n\n\t// Name of the project, to be used in the messages.\n\tcfg.ProjectName = \"example\"\n\n\t// Compose YAML content, a standard docker compose version 2 file.\n\tcfg.Compose = [][]byte{yml}\n\n\t// The defined YAML, contains a template, some variables are not standard\n\t// variables, so we need to define it at the `Config.TemplateVars` field.\n\tcfg.TemplateVars = map[string]interface{}{\n\t\t\"RedisTag\": \"4.0.6-alpine\",\n\t}\n\n\t// Customized message for a success installation.\n\tcfg.Install.Messages.Success = \"\" +\n\t\t\"The example was successfully installed!\\n\\n\" +\n\n\t\t\"To test the deployment please navigate to:\\n\" +\n\t\t\"http://localhost:5000\\n\\n\" +\n\n\t\t\"To uninstall this example, just execute:\\n\" +\n\t\t\"./example uninstall\\n\"\n\n\t// New instance of a Installer based on the given Config.\n\tp, err := installer.New(\"compose-installer-example\", cfg)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Execution of the application.\n\tp.Run()\n}\n\n// Standard docker compose yaml file from:\n// https://docs.docker.com/compose/gettingstarted/#where-to-go-next\nvar yml []byte = []byte(`\nversion: '2'\nservices:\n  web:\n    image: srcd/compose-example\n    ports:\n     - \"5000:5000\"\n  redis:\n    image: \"redis:{{.RedisTag}}\"\n`)\n```\n\nThe following code provides an CLI application allowing to anyone with just one\ncommand to install, start, stop and uninstall the environment, without any\nexternal dependency besides docker.\n\n```sh\nUsage:\n  compose-installer-example [OPTIONS] \u003ccommand\u003e\n\nHelp Options:\n  -h, --help  Show this help message\n\nAvailable commands:\n  install    Installs example into your system.\n  start      Stars example.\n  status     Show the status of example.\n  stop       Stops example.\n  uninstall  Remove example from your system.\n```\n\n## Go Template support\n\nGo templates are supported in the yaml file and also at all the messages.\n\nThe Template variables can be configured at the `Config.TemplateVars`, additionally\nto the custom defined variables some other variables are defined by default.\n\nThis is the list of default variables:\n\n- `.Project` - The project name, from the given `Config.ProjectName`.\n- `.Home` - Home folder of the user executing the installer.\n- `.OS` - Content of runtime.GOOS.\n- `.Arch` - Content ofruntime.GOARCH.\n- `.Error` - Only available at `Failure` messages, is the string of the error.\n\n# License\n\nApache License Version 2.0, see [LICENSE](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrc-d%2Fgo-compose-installer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrc-d%2Fgo-compose-installer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrc-d%2Fgo-compose-installer/lists"}