+ fx
Some checks failed
ci/woodpecker/push/fx_ingestor Pipeline failed
ci/woodpecker/push/fx_oracle Pipeline failed
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful

This commit is contained in:
Stephan D
2025-11-07 20:13:41 +01:00
parent 62a6631b9a
commit ec3019c462
11 changed files with 496 additions and 4 deletions

View File

@@ -0,0 +1,34 @@
# 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
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"]

View File

@@ -0,0 +1,39 @@
# Compose v2 - FX ingestor
x-common-env: &common-env
env_file:
- ../env/.env.runtime
- ../env/.env.version
networks:
sendico-net:
external: true
name: sendico-net
services:
sendico_fx_ingestor:
<<: *common-env
container_name: sendico-fx-ingestor
restart: unless-stopped
image: ${REGISTRY_URL}/fx/ingestor:${APP_V}
pull_policy: always
environment:
FX_MONGO_HOST: ${FX_MONGO_HOST}
FX_MONGO_PORT: ${FX_MONGO_PORT}
FX_MONGO_DATABASE: ${FX_MONGO_DATABASE}
FX_MONGO_USER: ${FX_MONGO_USER}
FX_MONGO_PASSWORD: ${FX_MONGO_PASSWORD}
FX_MONGO_AUTH_SOURCE: ${FX_MONGO_AUTH_SOURCE}
FX_MONGO_REPLICA_SET: ${FX_MONGO_REPLICA_SET}
FX_INGESTOR_METRICS_PORT: ${FX_INGESTOR_METRICS_PORT}
command: ["--config.file", "/app/config.yml"]
ports:
- "0.0.0.0:${FX_INGESTOR_METRICS_PORT}:${FX_INGESTOR_METRICS_PORT}"
healthcheck:
test: ["CMD-SHELL","wget -qO- http://localhost:${FX_INGESTOR_METRICS_PORT}/health | grep -q '\"status\":\"ok\"'"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
- sendico-net

View File

@@ -0,0 +1,34 @@
# 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
WORKDIR /src
COPY . .
WORKDIR /src/api/fx/oracle
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/oracle/internal/appversion.Version=${APP_VERSION} \
-X github.com/tech/sendico/fx/oracle/internal/appversion.Revision=${GIT_REV} \
-X github.com/tech/sendico/fx/oracle/internal/appversion.Branch=${BUILD_BRANCH} \
-X github.com/tech/sendico/fx/oracle/internal/appversion.BuildUser=${BUILD_USER} \
-X github.com/tech/sendico/fx/oracle/internal/appversion.BuildDate=${BUILD_DATE}" \
-o /out/fx-oracle .
FROM alpine:latest AS runtime
RUN apk add --no-cache ca-certificates tzdata wget
WORKDIR /app
COPY api/fx/oracle/config.yml /app/config.yml
COPY --from=build /out/fx-oracle /app/fx-oracle
EXPOSE 50051 9400
ENTRYPOINT ["/app/fx-oracle"]
CMD ["--config.file", "/app/config.yml"]

View File

@@ -0,0 +1,46 @@
# Compose v2 - FX oracle
x-common-env: &common-env
env_file:
- ../env/.env.runtime
- ../env/.env.version
networks:
sendico-net:
external: true
name: sendico-net
services:
sendico_fx_oracle:
<<: *common-env
container_name: sendico-fx-oracle
restart: unless-stopped
image: ${REGISTRY_URL}/fx/oracle:${APP_V}
pull_policy: always
environment:
FX_MONGO_HOST: ${FX_MONGO_HOST}
FX_MONGO_PORT: ${FX_MONGO_PORT}
FX_MONGO_DATABASE: ${FX_MONGO_DATABASE}
FX_MONGO_USER: ${FX_MONGO_USER}
FX_MONGO_PASSWORD: ${FX_MONGO_PASSWORD}
FX_MONGO_AUTH_SOURCE: ${FX_MONGO_AUTH_SOURCE}
FX_MONGO_REPLICA_SET: ${FX_MONGO_REPLICA_SET}
FX_ORACLE_GRPC_PORT: ${FX_ORACLE_GRPC_PORT}
FX_ORACLE_METRICS_PORT: ${FX_ORACLE_METRICS_PORT}
NATS_URL: ${FX_NATS_URL}
NATS_HOST: ${NATS_HOST}
NATS_PORT: ${NATS_PORT}
NATS_USER: ${NATS_USER}
NATS_PASSWORD: ${NATS_PASSWORD}
command: ["--config.file", "/app/config.yml"]
ports:
- "0.0.0.0:${FX_ORACLE_GRPC_PORT}:50051"
- "0.0.0.0:${FX_ORACLE_METRICS_PORT}:${FX_ORACLE_METRICS_PORT}"
healthcheck:
test: ["CMD-SHELL","wget -qO- http://localhost:${FX_ORACLE_METRICS_PORT}/health | grep -q '\"status\":\"ok\"'"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
- sendico-net

View File

@@ -1,4 +1,4 @@
FROM docker.io/library/busybox:1.36.1-musl AS busybox
FROM docker.io/library/busybox:stable-musl AS busybox
FROM docker.io/library/nats:latest
COPY --from=busybox /bin/busybox /bin/busybox