2026-08-08 18:17:10 -03:00
|
|
|
# dockerfiles/Dockerfile.hermes-chat-router
|
|
|
|
|
FROM --platform=$BUILDPLATFORM golang:1.24-alpine@sha256:8bee1901f1e530bfb4a7850aa7a479d17ae3a18beb6e09064ed54cfd245b7191 AS build
|
|
|
|
|
|
2026-08-15 22:32:08 -03:00
|
|
|
ARG TARGETOS=linux
|
|
|
|
|
ARG TARGETARCH=arm64
|
2026-08-08 18:17:10 -03:00
|
|
|
|
|
|
|
|
WORKDIR /src
|
|
|
|
|
COPY services/hermes/router/ ./
|
|
|
|
|
|
|
|
|
|
RUN GO111MODULE=off CGO_ENABLED=0 go test . \
|
|
|
|
|
&& GOOS=${TARGETOS} GOARCH=${TARGETARCH} GO111MODULE=off CGO_ENABLED=0 go build \
|
|
|
|
|
-trimpath \
|
|
|
|
|
-ldflags="-s -w" \
|
|
|
|
|
-o /out/chat-router .
|
|
|
|
|
|
|
|
|
|
FROM scratch
|
|
|
|
|
|
|
|
|
|
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
|
|
|
|
COPY --from=build --chown=10000:10000 /out/chat-router /chat-router
|
|
|
|
|
|
|
|
|
|
USER 10000:10000
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
ENTRYPOINT ["/chat-router"]
|