1
0
Fork 0

build: optimize docker build times

This commit is contained in:
Arthur K. 2026-01-17 18:41:16 +03:00
parent 1e0ee5bffe
commit 3a38ff13ca
Signed by: wzray
GPG key ID: B97F30FDC4636357

View file

@ -1,17 +1,20 @@
FROM golang:alpine AS builder
WORKDIR /app
RUN apk --no-cache add make;
COPY go.mod .
COPY go.sum .
RUN go mod download;
COPY . .
RUN make hivemind;
ENV GOCACHE=/cache/go-build
RUN --mount=type=cache,target="/cache/go-build" mkdir -p /cache/go-build; make hivemind;
FROM alpine
EXPOSE 56714/tcp
WORKDIR /app
VOLUME /conf
@ -21,5 +24,4 @@ ENV HIVEMIND_CONFIG_FILE=/conf/config.toml
ENV HIVEMIND_REGISTRY_FILE=/data/registry.json
COPY --from=builder /app/build/hivemind .
CMD ["./hivemind"]