Compare commits
No commits in common. "e9b5231cc81511cf6327e5954826db4f33075a3f" and "24fcde5955cc13bd606a6c4e523598954913972d" have entirely different histories.
e9b5231cc8
...
24fcde5955
3 changed files with 8 additions and 10 deletions
10
Dockerfile
10
Dockerfile
|
|
@ -1,20 +1,17 @@
|
|||
FROM golang:alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk --no-cache add make;
|
||||
|
||||
COPY go.mod .
|
||||
COPY go.sum .
|
||||
|
||||
RUN go mod download;
|
||||
COPY . .
|
||||
|
||||
ENV GOCACHE=/cache/go-build
|
||||
RUN --mount=type=cache,target="/cache/go-build" mkdir -p /cache/go-build; make hivemind;
|
||||
RUN make hivemind;
|
||||
|
||||
FROM alpine
|
||||
|
||||
EXPOSE 56714/tcp
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
VOLUME /conf
|
||||
|
|
@ -24,4 +21,5 @@ ENV HIVEMIND_CONFIG_FILE=/conf/config.toml
|
|||
ENV HIVEMIND_REGISTRY_FILE=/data/registry.json
|
||||
|
||||
COPY --from=builder /app/build/hivemind .
|
||||
|
||||
CMD ["./hivemind"]
|
||||
|
|
|
|||
|
|
@ -48,10 +48,10 @@ func parseState(state types.HostState) (string, []byte) {
|
|||
var builder strings.Builder
|
||||
|
||||
for _, d := range state.Domains {
|
||||
builder.WriteString(fmt.Sprintf("%s %s\n", state.Endpoint, d))
|
||||
builder.WriteString(fmt.Sprintf("%s %s\n", state.Name, d))
|
||||
}
|
||||
|
||||
return hostsDir + state.Name, []byte(builder.String())
|
||||
return hostsDir + state.Endpoint, []byte(builder.String())
|
||||
}
|
||||
|
||||
func (r *Role) OnStartup(ctx context.Context) error {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ type Role struct {
|
|||
|
||||
func New(state *state.RuntimeState, config config.HostConfig) *Role {
|
||||
return &Role{
|
||||
client: newClient(config.Domain, config.LocalAddress),
|
||||
client: newClient(config.Domain, config.IpAddress),
|
||||
state: state,
|
||||
config: config,
|
||||
}
|
||||
|
|
@ -87,7 +87,7 @@ func (r *Role) onCallback(w http.ResponseWriter, req *http.Request) {
|
|||
func (r *Role) getInternal() (types.HostState, error) {
|
||||
return types.HostState{
|
||||
Domains: r.internalDomains,
|
||||
Endpoint: r.config.IpAddress,
|
||||
Endpoint: r.state.Self.Address,
|
||||
Name: r.state.Self.Name,
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue