Files
nomad/demo/countdash/counter-api/Dockerfile
Seth Hoenig f9034b3387 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

26 lines
554 B
Docker

FROM golang:alpine as builder
WORKDIR /build
ADD ./Dockerfile /build
RUN apk add git && \
git clone -b 0.0.3 https://github.com/hashicorp/demo-consul-101.git
WORKDIR /build/demo-consul-101/services/counting-service
ADD ./go.mod .
RUN go version && \
go env && \
go generate && \
GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build
FROM alpine:latest
MAINTAINER nomadproject.io
WORKDIR /opt
COPY --from=builder /build/demo-consul-101/services/counting-service/counter-api /opt
EXPOSE 9001
ENV PORT 9001
ENTRYPOINT ["/opt/counter-api"]