billing fees build
All checks were successful
All checks were successful
This commit is contained in:
40
ci/prod/compose/billing_fees.dockerfile
Normal file
40
ci/prod/compose/billing_fees.dockerfile
Normal file
@@ -0,0 +1,40 @@
|
||||
# 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/billing/fees
|
||||
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/billing/fees/internal/appversion.Version=${APP_VERSION} \
|
||||
-X github.com/tech/sendico/billing/fees/internal/appversion.Revision=${GIT_REV} \
|
||||
-X github.com/tech/sendico/billing/fees/internal/appversion.Branch=${BUILD_BRANCH} \
|
||||
-X github.com/tech/sendico/billing/fees/internal/appversion.BuildUser=${BUILD_USER} \
|
||||
-X github.com/tech/sendico/billing/fees/internal/appversion.BuildDate=${BUILD_DATE}" \
|
||||
-o /out/billing-fees .
|
||||
|
||||
FROM alpine:latest AS runtime
|
||||
RUN apk add --no-cache ca-certificates tzdata wget
|
||||
WORKDIR /app
|
||||
COPY api/billing/fees/config.yml /app/config.yml
|
||||
COPY --from=build /out/billing-fees /app/billing-fees
|
||||
EXPOSE 50060 9402
|
||||
ENTRYPOINT ["/app/billing-fees"]
|
||||
CMD ["--config.file", "/app/config.yml"]
|
||||
46
ci/prod/compose/billing_fees.yml
Normal file
46
ci/prod/compose/billing_fees.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
# Compose v2 - Billing fees
|
||||
|
||||
x-common-env: &common-env
|
||||
env_file:
|
||||
- ../env/.env.runtime
|
||||
- ../env/.env.version
|
||||
|
||||
networks:
|
||||
sendico-net:
|
||||
external: true
|
||||
name: sendico-net
|
||||
|
||||
services:
|
||||
sendico_billing_fees:
|
||||
<<: *common-env
|
||||
container_name: sendico-billing-fees
|
||||
restart: unless-stopped
|
||||
image: ${REGISTRY_URL}/billing/fees:${APP_V}
|
||||
pull_policy: always
|
||||
environment:
|
||||
FEES_MONGO_HOST: ${FEES_MONGO_HOST}
|
||||
FEES_MONGO_PORT: ${FEES_MONGO_PORT}
|
||||
FEES_MONGO_DATABASE: ${FEES_MONGO_DATABASE}
|
||||
FEES_MONGO_USER: ${FEES_MONGO_USER}
|
||||
FEES_MONGO_PASSWORD: ${FEES_MONGO_PASSWORD}
|
||||
FEES_MONGO_AUTH_SOURCE: ${FEES_MONGO_AUTH_SOURCE}
|
||||
FEES_MONGO_REPLICA_SET: ${FEES_MONGO_REPLICA_SET}
|
||||
FEES_GRPC_PORT: ${FEES_GRPC_PORT}
|
||||
FEES_METRICS_PORT: ${FEES_METRICS_PORT}
|
||||
NATS_URL: ${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:${FEES_GRPC_PORT}:50060"
|
||||
- "0.0.0.0:${FEES_METRICS_PORT}:${FEES_METRICS_PORT}"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL","wget -qO- http://localhost:${FEES_METRICS_PORT}/health | grep -q '\"status\":\"ok\"'"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 60s
|
||||
networks:
|
||||
- sendico-net
|
||||
Reference in New Issue
Block a user