Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bsramin/dch
Docker Compose Helper
https://github.com/bsramin/dch
dch developer-tools development development-environment docker docker-compose docker-compose-development docker-compose-template docker-container dockerfile helper
Last synced: 15 days ago
JSON representation
Docker Compose Helper
- Host: GitHub
- URL: https://github.com/bsramin/dch
- Owner: bsramin
- License: mit
- Created: 2018-08-14T08:03:56.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-29T14:48:21.000Z (about 5 years ago)
- Last Synced: 2024-10-10T14:20:30.748Z (3 months ago)
- Topics: dch, developer-tools, development, development-environment, docker, docker-compose, docker-compose-development, docker-compose-template, docker-container, dockerfile, helper
- Language: Shell
- Size: 45.9 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
![DCH](docs/logo_dch.png)
DCH is an Helper to simplify the use of `docker compose` in the development environment only.
## Installation
Prerequisites:
- docker 18.02.0+
- docker-compose 1.20.0+### Docker Compose
Place your docker-compose.yml in the `/project` directory
The commands available for the management of containers are:
```
bin/up # Activate containers
bin/down # Switch off containers
bin/restart # Restart containers
bin/status # Verifies the status of containers, and images
bin/run # Executes a command inside one of the containers
bin/open # Opens a bash shell (or zsh shell) inside one of the containers (if provided)
bin/build # Container construction
bin/setup # Executes maintenance commands
bin/project # If the project provides for it, it executes commands linked to the project itself
```### (mac only) NFS Server
To bypass the problem of slow volumes shared with osxfs, Docker 18.03.0-ce-mac59 has implemented the possibility of sharing with NFS.
**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.
The NFS volume is declared in the file `docker-compose.yml` as follows
```
app-data:
driver: local
driver_opts:
type: nfs
o: rw,async,noatime,rsize=32768,wsize=32768,proto=tcp,nfsvers=3,addr=host.docker.internal
# If you are running MacOS < 10.15
device: ":${APP_PATH}"
# If you are running MacOS >= 10.15
# device: ':/System/Volumes/Data${APP_PATH}'
```To start the service on the host mac edit the file `/etc/exports` and adding the line
If you are running MacOS < 10.15
```"/Users" localhost -alldirs -mapall=501:20```
instead if you are running MacOS >= 10.15
```"/System/Volumes/Data" -alldirs -mapall=501:20 localhost```
Add this line to the `/etc/nfs.conf` file:
```nfs.server.mount.require_resv_port = 0```
And finally start/restart the nfs service
```sudo nfsd restart```
### Proxy configuration tld .localhost to docker
As an alternative to configuring the individual domains in the /etc/hosts file, you can manage an entire tld addressed to Docker
#### macOS
Install dnsmasq (needs homebrew [see https://brew.sh/index_en.html])
brew install dnsmasq
Edit the configuration file `/usr/local/etc/dnsmasq.conf`
address=/.localhost/127.0.0.1
listen-address=127.0.0.1Start the service
sudo brew services start dnsmasq
Configure the DNS resolution
sudo mkdir -p /etc/resolver
sudo tee /etc/resolver/localhost > /dev/null <