fix: (issues/9) Worker does not support port assignment for routers (#11)

Quite a refactor and some code cleanup.

Co-authored-by: James Wells <jwells@dragonheim.net>
Reviewed-on: #11
Co-authored-by: James Wells <jwells@noreply.localhost>
Co-committed-by: James Wells <jwells@noreply.localhost>
This commit is contained in:
James Wells 2021-05-21 23:03:50 +00:00
parent 881a11316d
commit 7d6fbfef24
21 changed files with 451 additions and 271 deletions

View file

@ -2,21 +2,27 @@ FROM golang:1.16-alpine3.12 as builder
WORKDIR /gagent
COPY . .
RUN apk add --no-cache zeromq-dev build-base git && \
go build -o /gagent/bin/gagent gagent/main.go && \
strip /gagent/bin/gagent
ARG GOOS=${GOOS:-linux}
# ARG GOARCH=${GOARCH:-amd64}
ARG CGO_ENABLED=1
RUN apk add --no-cache zeromq-dev build-base git
RUN go build -o /gagent/bin/gagent gagent/main.go
RUN strip /gagent/bin/gagent
FROM alpine:3.12
LABEL Name="G'Agent"
LABEL Maintainer="jwells@dragonheim.net"
LABEL License="MIT License"
RUN apk add --no-cache zeromq; mkdir -p -m 0700 /etc/gagent
RUN apk add --no-cache zeromq && mkdir -p -m 0700 /etc/gagent
COPY --from=builder /gagent/examples/example_gagent.hcl /etc/gagent/gagent.hcl
COPY --from=builder /gagent/examples/gagent.hcl /etc/gagent/gagent.hcl
COPY --from=builder /gagent/bin/gagent /usr/bin/
EXPOSE 35570/tcp
# Router Client Worker
EXPOSE 35570/tcp 35571/tcp 35572/tcp
VOLUME /etc/gagent
CMD ["/usr/bin/gagent"]