docker pull microhq/micro
consul:
command: -server -bootstrap -rejoin
image: progrium/consul:latest
hostname: "registry"
ports:
- "8300:8300"
- "8400:8400"
- "8500:8500"
- "8600:53/udp"
api:
command: --registry_address=registry:8500 --register_interval=5 --register_ttl=10 api
build: .
links:
- consul
ports:
- "8080:8080"
sidecar:
command: --registry_address=registry:8500 --register_interval=5 --register_ttl=10 sidecar
build: .
links:
- consul
ports:
- "8081:8081"
web:
command: --registry_address=registry:8500 --register_interval=5 --register_ttl=10 web
build: .
links:
- consul
ports:
- "8082:8082"
FROM alpine:3.2
RUN apk add --update ca-certificates && \
rm -rf /var/cache/apk/* /tmp/*
ADD micro /micro
WORKDIR /
ENTRYPOINT [ "/micro" ]
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' -i -o micro ./main.go