Files
sendico/ci/prod/compose/fx_ingestor.dockerfile
Stephan D f9b7114a6d
Some checks failed
ci/woodpecker/push/fx/1 Pipeline failed
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/nats Pipeline failed
ci/woodpecker/push/fx/2 Pipeline failed
fx build fix
2025-11-08 02:58:00 +01:00

36 lines
1.2 KiB
Docker

# syntax=docker/dockerfile:1.7
ARG TARGETOS=linux
ARG TARGETARCH=amd64
FROM golang:alpine AS build
ARG APP_VERSION=dev
ARG GIT_REV=unknown
ARG BUILD_BRANCH=unknown
ARG BUILD_DATE=unknown
ARG BUILD_USER=ci
ENV GO111MODULE=on
WORKDIR /src
COPY . .
WORKDIR /src/api/fx/ingestor
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
go build -trimpath -ldflags "\
-s -w \
-X github.com/tech/sendico/fx/ingestor/internal/appversion.Version=${APP_VERSION} \
-X github.com/tech/sendico/fx/ingestor/internal/appversion.Revision=${GIT_REV} \
-X github.com/tech/sendico/fx/ingestor/internal/appversion.Branch=${BUILD_BRANCH} \
-X github.com/tech/sendico/fx/ingestor/internal/appversion.BuildUser=${BUILD_USER} \
-X github.com/tech/sendico/fx/ingestor/internal/appversion.BuildDate=${BUILD_DATE}" \
-o /out/fx-ingestor .
FROM alpine:latest AS runtime
RUN apk add --no-cache ca-certificates tzdata wget
WORKDIR /app
COPY api/fx/ingestor/config.yml /app/config.yml
COPY --from=build /out/fx-ingestor /app/fx-ingestor
EXPOSE 9102
ENTRYPOINT ["/app/fx-ingestor"]
CMD ["--config.file", "/app/config.yml"]