{"id":15666489,"url":"https://github.com/bsramin/dch","last_synced_at":"2026-04-18T06:38:10.830Z","repository":{"id":71303740,"uuid":"144688535","full_name":"bsramin/dch","owner":"bsramin","description":"Docker Compose Helper","archived":false,"fork":false,"pushed_at":"2019-10-29T14:48:21.000Z","size":47,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T06:44:01.543Z","etag":null,"topics":["dch","developer-tools","development","development-environment","docker","docker-compose","docker-compose-development","docker-compose-template","docker-container","dockerfile","helper"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/bsramin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2018-08-14T08:03:56.000Z","updated_at":"2022-08-17T10:13:55.000Z","dependencies_parsed_at":"2023-02-24T06:30:44.488Z","dependency_job_id":null,"html_url":"https://github.com/bsramin/dch","commit_stats":{"total_commits":9,"total_committers":3,"mean_commits":3.0,"dds":"0.33333333333333337","last_synced_commit":"a624af586f2ffca51d5bd1433f6d95a375e4536e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsramin%2Fdch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsramin%2Fdch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsramin%2Fdch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsramin%2Fdch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bsramin","download_url":"https://codeload.github.com/bsramin/dch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246276793,"owners_count":20751527,"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":["dch","developer-tools","development","development-environment","docker","docker-compose","docker-compose-development","docker-compose-template","docker-container","dockerfile","helper"],"created_at":"2024-10-03T14:00:44.002Z","updated_at":"2026-04-18T06:38:10.802Z","avatar_url":"https://github.com/bsramin.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![DCH](docs/logo_dch.png)\n\nDCH is an Helper to simplify the use of `docker compose` in the development environment only.\n\n## Installation\n\nPrerequisites:\n- docker 18.02.0+\n- docker-compose 1.20.0+\n\n### Docker Compose\n\nPlace your docker-compose.yml in the `/project` directory\n\nThe commands available for the management of containers are:\n\n```\n    bin/up        # Activate containers\n    bin/down      # Switch off containers\n    bin/restart   # Restart containers\n    bin/status    # Verifies the status of containers, and images\n    bin/run       # Executes a command inside one of the containers\n    bin/open      # Opens a bash shell (or zsh shell) inside one of the containers (if provided)\n    bin/build     # Container construction\n    bin/setup     # Executes maintenance commands\n    bin/project   # If the project provides for it, it executes commands linked to the project itself\n```\n\n### (mac only) NFS Server\n\nTo bypass the problem of slow volumes shared with osxfs, Docker 18.03.0-ce-mac59 has implemented the possibility of sharing with NFS.\n\n**NB:** Since the new version of MacOS Catalina (10.15), user volume was moved (apple call this *firmlinking*), you need to chose the right path, so please check your MacOS version and use the compatible script with your version.\n\nThe NFS volume is declared in the file `docker-compose.yml` as follows\n\n```\n  app-data:\n    driver: local\n    driver_opts:\n      type: nfs\n      o: rw,async,noatime,rsize=32768,wsize=32768,proto=tcp,nfsvers=3,addr=host.docker.internal\n      # If you are running MacOS \u003c 10.15\n      device: \":${APP_PATH}\"      \n      # If you are running MacOS \u003e= 10.15\n      # device: ':/System/Volumes/Data${APP_PATH}'\n```\n\nTo start the service on the host mac edit the file `/etc/exports` and adding the line\n\nIf you are running MacOS \u003c 10.15\n\n```\"/Users\" localhost -alldirs -mapall=501:20```\n\ninstead if you are running MacOS \u003e= 10.15\n\n```\"/System/Volumes/Data\" -alldirs -mapall=501:20 localhost```\n\nAdd this line to the `/etc/nfs.conf` file:\n\n```nfs.server.mount.require_resv_port = 0```\n\nAnd finally start/restart the nfs service\n\n```sudo nfsd restart```\n\n### Proxy configuration tld .localhost to docker\n\nAs an alternative to configuring the individual domains in the /etc/hosts file, you can manage an entire tld addressed to Docker\n\n#### macOS\n\nInstall dnsmasq (needs homebrew [see https://brew.sh/index_en.html])\n\n    brew install dnsmasq\n\nEdit the configuration file `/usr/local/etc/dnsmasq.conf`\n\n    address=/.localhost/127.0.0.1\n    listen-address=127.0.0.1\n\nStart the service\n\n    sudo brew services start dnsmasq\n\nConfigure the DNS resolution\n\n    sudo mkdir -p /etc/resolver\n    sudo tee /etc/resolver/localhost \u003e /dev/null \u003c\u003cEOF\n    nameserver 127.0.0.1\n    domain localhost\n    search_order 1\n    EOF\n\n#### Linux \n\nInstall dnsmasq (for Debian and it's derivatives, for other distro, use the package manager of your distribution)\n\n    sudo apt-get install dnsmasq\n    \nCreate the file `/etc/dnsmasq.d/localhost-tld` containing:    \n\n    local=/localhost/\n    address=/localhost/127.0.0.1\n    \nAnd restart the service\n\n    sudo /etc/init.d/dnsmasq restart\n    \n### Reverse proxy\n##### (optional)\n\nDCH includes an automatic reverse proxy service (thanks to [jwilder/nginx-proxy](https://github.com/jwilder/nginx-proxy)) to be able to work with multiple domains, on multiple containers/domains of DCH and always keeping port 80 (which automatically redirects to the actual container port, different from 80).\n\nIn the project, in `docker-compose.yml` to the definition of the networks add\n\n```\nnetworks:\n  reverse-proxy:\n    external:\n      name: dch-reverse-proxy\n``` \n\nand in the definition of the webserver container (apache, nginx, ...), always in `docker-compose.yml` attach to the network\n\n```\nnetworks:\n    (....)\n    reverse-proxy:\n```\n\nand add the `VIRTUAL_HOST` and `VIRTUAL_PORT` as environment variables\n\n```\nenvironment:\n  - VIRTUAL_HOST=${APP_HOST}\n  - VIRTUAL_PORT=[service exposed port, For example: in \"ports: 8080:80\" write \"80\" here]\n```\n\nand then start with `bin/up -r` command.\n\nYou can also use it on multiple services at the same time, remembering to do the above for everyone\n\n## SAMPLE\n\nLook at the [example project](https://github.com/bsramin/dch-project-sample) (LEMP Stack).\n\n# LICENSE\n    \nThe MIT License (MIT)\n\nCopyright (c) 2018 Ramin Banihashemi\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsramin%2Fdch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbsramin%2Fdch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsramin%2Fdch/lists"}