{"id":13416209,"url":"https://github.com/pbertera/dcw","last_synced_at":"2025-03-14T23:31:25.233Z","repository":{"id":141463502,"uuid":"54673233","full_name":"pbertera/dcw","owner":"pbertera","description":"Docker Compose Wrapper (a poor man's PAAS management tool)","archived":false,"fork":false,"pushed_at":"2017-03-29T07:55:37.000Z","size":6,"stargazers_count":16,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-07-31T21:55:30.759Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/pbertera.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-03-24T20:48:58.000Z","updated_at":"2023-03-12T06:16:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"232ce44d-2323-4b63-9e2b-3ded3f4b87eb","html_url":"https://github.com/pbertera/dcw","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/pbertera%2Fdcw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pbertera%2Fdcw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pbertera%2Fdcw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pbertera%2Fdcw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pbertera","download_url":"https://codeload.github.com/pbertera/dcw/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243663488,"owners_count":20327299,"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":"2024-07-30T21:00:55.489Z","updated_at":"2025-03-14T23:31:22.410Z","avatar_url":"https://github.com/pbertera.png","language":"Shell","readme":"# Docker Compose Wrapper\n\nDocker Compose Wrapper is a poor-man PAAS management tool.\nThis script provides a wrapper to the *docker-compose* command and permits to expose commands that can be executed on the Docker host.\n\nThe common use-case for this tool is to be used as an SSH command executed trough the `~/.ssh/authorized_keys` file, see below.\n\n### SECURITY CONSIDERATIONS\n\nIf you are using Docker Compose Wrapper you are trusting your users. This wrapper doesn't provide any security layer: the aim is just to\nexpose some commands to users in order to permit them to easily deploy and manage well-defined containers or actions.\n\n## Configuration\n\nThe wrapper can be easily configured trough some variables defined in the script:\n\n* **dc_confd**: the directory conatining all the docker-compose YAML files\n* **command_label_root**: the root label namespace for commands\n* **dc_denied_commands**: all the docker-compose commands matching this regex will be denied\n* **slack_webook**: the SLACK incoming [webook](https://api.slack.com/incoming-webhooks) for the notification bot, if not configured the SLACK notifications are disabled\n* **slack_channel**: the SLACK notification channel\n* **slack_botemoji**: the SLACK bot emoji\n* **slack_botname**: the SLACK bot name\n* **slack_message_prefix**: the SLACK message prefix\n* **hipchat_webhook**: The HipChat incoming [webhook](https://www.hipchat.com/docs/apiv2/method/send_room_notification) for the notification bot, if not configured the HipChat notifications are disabled\n* **hipchat_message_prefix**: the HipChat message prefix\n\n### Pool definition\n\nIn order to define a pool you have to create a docker-compose YAML file into the **dc_confd** directory. The file name will define the pool name (Eg. nginx.yaml will define the nginx pool).\nIf you want to expose some commands to exec you have to define a label under the **command_label_root** namespace:\n\nThe following example defines a pool containing a single container (named nginx1) exposing the **shell** command, executing the **shell** command trough the wrapper will execute **docker exec -it nginx1 /bin/bash**\n\n```yaml\nversion: '2'\nservices:\n    nginx1:\n        image: nginx\n        labels:\n            management.command.shell: \"docker exec -it nginx1 /bin/bash\"\n        container_name: nginx1\n        stdin_open: true\n        tty: true\n```\n\n### SSH Usage\n\nThe common usage scenario is to use this wrapper as an SSH command wrapper adding the *command* parameter to the **authorized_keys**:\n\n```\ncommand=\"/opt/bin/dcw\",no-port-forwarding,no-agent-forwarding,no-X11-forwarding ssh-rsa AAAAB3NzaC1 [..] == pietro@hank\n```\n\n## Usage\n\n```\nUsage:\n\n./dcw \u003cpool|command\u003e \u003cargs\u003e\n\nExamples:\n\n./dcw pool ldap ps\n\n    Run the docker-compose ps over the ldap service pool\n\n./dcw pool ldap start ldap1\n\n    Start the service ldap1 from the ldap pool\n\n./dcw command ldap1 shell\n\n    Execute the command defined into the label 'management.command.shell' of the ldap1 container\n\n./dcw command ldap1 help\n\n    List all the available commands into the container ldap1\n```\n\n#### Actions\n\nAction can be *pool* or *command*\n\n##### Pool\n\nThe *pool* action requires the pool name, pool action is a simple docker-compose wrapper using the pool-related YAML configuration file, so you can execute all the available docket-compose commands. Trough the **dc_confd** variable you have to configure the directory containing all the docker-compose YAML files.\n\n###### Example:\n\nThe following command prints the YAML docker-compose configuration file for the *ldap* pool (executes **docker-compose -f ${dc_confd}/\u003cpool\u003e.yaml**):\n\n```\n./dcw pool ldap config\n```\n\nThe following command starts all the containers of the *ldap* pool:\n\n```\n./dcw pool ldap up -d\n```\n\n##### Command\n\nThe *command* action executes a command defined on a container label. The label name must be into the **action_label_root** namespace:\n\nContainer *ldap1* label *management.command.shell*\n\n```\n$ docker inspect -f '{{ index .Config.Labels \"management.command.shell\" }}' ldap1\ndocker exec -it ldap1 /bin/bash \n```\n\nExecuting the *shell* command on the *ldap1* container:\n\n```\n./dcw command ldap1 shell\nINFO: executing command from label *management.command.shell* into container *ldap1*\nroot@72b78ab8b5d1:/# \n```\n","funding_links":[],"categories":["Container Operations","PaaS"],"sub_categories":["PaaS"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpbertera%2Fdcw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpbertera%2Fdcw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpbertera%2Fdcw/lists"}