https://github.com/srvc/ery
🔍 Discover services in local
https://github.com/srvc/ery
cli dns local-development service-discovery
Last synced: about 1 year ago
JSON representation
🔍 Discover services in local
- Host: GitHub
- URL: https://github.com/srvc/ery
- Owner: srvc
- License: mit
- Created: 2018-05-29T13:21:09.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-09-16T12:51:44.000Z (almost 7 years ago)
- Last Synced: 2024-11-05T22:41:50.819Z (over 1 year ago)
- Topics: cli, dns, local-development, service-discovery
- Language: Go
- Homepage:
- Size: 255 KB
- Stars: 7
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ery
[](https://travis-ci.com/srvc/ery)
[](https://goreportcard.com/report/github.com/srvc/ery)
[](./LICENSE)
[](https://badge.fury.io/go/github.com%2Fsrvc%2Fery)
:mag: Discover services in local.
[](https://asciinema.org/a/212433)
## Usage
### For local processes
You should create a configuration file. you can generate it via `ery init` command.
```sh
# when your current working directory is "~/src/github.com/yourname/awesomeapp",
# a default hostname uses `awesomeapp.yourname.ery`.
ery init
```
any commands prefixed by `ery` sets `PORT` to environment variables at random.
```sh
ery rails s
```
### For docker containers
`ery` reads exposed ports automatically. You have only to set a hostname through label of the container.
```sh
# you can access the rails server with "http://yourapp.ery"
$ docker run \
--rm \
--label tools.srvc.ery.hostname=yourapp.ery \
-p 80:12345 \
yourapp \
rails s -p 80
```
## Installation
1. Install `ery`
- linux
- ```
curl -Lo ery https://github.com/srvc/ery/releases/download/v0.0.1/ery_linux_amd64 && chmod +x ery && sudo mv ery /usr/local/bin
```
- macOS
- ```
curl -Lo ery https://github.com/srvc/ery/releases/download/v0.0.1/ery_darwin_amd64 && chmod +x ery && sudo mv ery /usr/local/bin
```
- build yourself
- `go get github.com/srvc/ery/cmd/ery`
1. Configure nameserver
- linux
- `sudo sh -c 'echo "nameserver 127.0.0.1" >> /etc/resolv.conf'`
- macOS
- `sudo sh -c 'echo "nameserver 127.0.0.1" >> /etc/resolver/ery'`
- if you wanna use other TLDs, you should replace "ery" to others on above command
1. Add loopback address aliases (macOS only)
- `for i in $(seq 1 255); do /sbin/ifconfig lo0 alias 127.0.0.$i; done`
1. Register as a startup process
- `sudo ery daemon install`
- `sudo ery daemon start`
## Author
- Masayuki Izumi ([@izumin5210](https://github.com/izumin5210))
## License
ery is licensed under the MIT License. See [LICENSE](./LICENSE)