open-nomad/demo/countdash/README.md
Seth Hoenig 334d2abb20 demo: create build scripts for our countdash demo
We use the education team's "countdash" demo in many places
to showcase Nomad's Consul Connect integration. This change
adds a Dockerfile for each of `counter-dashboard` and
`counter-api` that can be used to build artifacts to publish
to Nomad's Docker Hub organization.

The recent "0.0.3" release of the `countdash` demo includes
changes we want in order to demo task group service checks.
2020-04-22 12:30:26 -06:00

34 lines
1.4 KiB
Markdown

# countdash
Nomad makes use of the [demo-consul-101](https://github.com/hashicorp/demo-consul-101)
education material throughout our examples for using Consul Connect. There are many
example jobs that launch tasks with [counting-service](https://github.com/hashicorp/demo-consul-101/tree/master/services/counting-service)
and [dashboard-service](https://github.com/hashicorp/demo-consul-101/tree/master/services/dashboard-service)
configured to communicate under various conditions.
## Publishing
When making changes to the `countdash` demo, open a PR against the [demo-consul-101](https://github.com/hashicorp/demo-consul-101)
project. Be sure to preserve backwards compatibility, as these demo files are used
extensively, including with other Consul integrations.
The docker images specific to Nomad can be rebuilt using [counter-dashboard](counter-dashboard/Dockerfile)
and [counter-api](counter-api/Dockerfile).
#### Testing locally
```bash
$ docker build -t hashicorpnomad/counter-api:test .
$ docker build -t hashicorpnomad/counter-dashboard:test .
$ docker run --rm --net=host hashicorpnomad/counter-api:test
$ docker run --rm --net=host --env COUNTING_SERVICE_URL="http://localhost:9001" hashicorpnomad/counter-dashboard:test
```
#### Upload to Docker Hub
```bash
# replace <version> with the next version number
docker login
docker build -t hashicorpnomad/counter-dashboard:<version> .
docker push hashicorpnomad/counter-dashboard:<version>
```