nootification build
Some checks failed
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/fx/1 Pipeline was successful
ci/woodpecker/push/fx/2 Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline failed
ci/woodpecker/push/payments_orchestrator Pipeline was successful

This commit is contained in:
Stephan D
2025-11-11 18:59:47 +01:00
parent 6f7ea2bf98
commit 43a18e37a0
7 changed files with 503 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
# 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
ENV PATH="/go/bin:${PATH}"
WORKDIR /src
COPY . .
RUN apk add --no-cache bash git build-base protoc protobuf-dev \
&& go install google.golang.org/protobuf/cmd/protoc-gen-go@latest \
&& go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest \
&& bash ci/scripts/proto/generate.sh
WORKDIR /src/api/notification
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/notification/internal/appversion.Version=${APP_VERSION} \
-X github.com/tech/sendico/notification/internal/appversion.Revision=${GIT_REV} \
-X github.com/tech/sendico/notification/internal/appversion.Branch=${BUILD_BRANCH} \
-X github.com/tech/sendico/notification/internal/appversion.BuildUser=${BUILD_USER} \
-X github.com/tech/sendico/notification/internal/appversion.BuildDate=${BUILD_DATE}" \
-o /out/notification .
FROM alpine:latest AS runtime
RUN apk add --no-cache ca-certificates tzdata wget
WORKDIR /app
COPY api/notification/config.yml /app/config.yml
COPY api/notification/i18n /app/i18n
COPY api/notification/env /app/env
COPY api/pkg/auth/internal/casbin/models/auth.conf /app/env/permissions_model.conf
COPY --from=build /out/notification /app/notification
EXPOSE 8081
ENTRYPOINT ["/app/notification"]
CMD ["--config.file", "/app/config.yml"]

View File

@@ -0,0 +1,54 @@
# Compose v2 - Notification service
x-common-env: &common-env
env_file:
- ../env/.env.runtime
- ../env/.env.version
networks:
sendico-net:
external: true
name: sendico-net
services:
sendico_notification:
<<: *common-env
container_name: sendico-notification
restart: unless-stopped
image: ${REGISTRY_URL}/notification/service:${APP_V}
pull_policy: always
environment:
AMPLI_ENVIRONMENT: ${AMPLI_ENVIRONMENT}
API_PROTOCOL: ${API_PROTOCOL}
SERVICE_HOST: ${SERVICE_HOST}
API_ENDPOINT: ${API_ENDPOINT}
API_ENDPOINT_SECRET: ${API_ENDPOINT_SECRET}
WS_ENDPOINT: ${WS_ENDPOINT}
NATS_HOST: ${NATS_HOST}
NATS_PORT: ${NATS_PORT}
NATS_USER: ${NATS_USER}
NATS_PASSWORD: ${NATS_PASSWORD}
NATS_URL: ${NATS_URL}
MAIL_USER: ${MAIL_USER}
MAIL_SECRET: ${MAIL_SECRET}
MONGO_HOST: ${MONGO_HOST}
MONGO_PORT: ${MONGO_PORT}
MONGO_DATABASE: ${MONGO_DATABASE}
MONGO_USER: ${MONGO_USER}
MONGO_PASSWORD: ${MONGO_PASSWORD}
MONGO_AUTH_SOURCE: ${MONGO_AUTH_SOURCE}
MONGO_REPLICA_SET: ${MONGO_REPLICA_SET}
PERMISSION_MODEL: ${PERMISSION_MODEL}
PERMISSION_COLLECTION: ${PERMISSION_COLLECTION}
PERMISSION_TIMEOUT: ${PERMISSION_TIMEOUT}
PERMISSION_IS_FILTERED: ${PERMISSION_IS_FILTERED}
ports:
- "0.0.0.0:${NOTIFICATION_HTTP_PORT}:8081"
healthcheck:
test: ["CMD-SHELL","wget -qO- http://localhost:8081/health | grep -q '\"status\":\"ok\"'"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
- sendico-net