Skip to content

Commit

Permalink
added Dockerfile and Makefile"
Browse files Browse the repository at this point in the history
  • Loading branch information
AitorAlgorta committed Feb 9, 2024
1 parent 4a7ccd3 commit 551539c
Show file tree
Hide file tree
Showing 13 changed files with 144 additions and 0 deletions.
19 changes: 19 additions & 0 deletions backend/components/schema-registry-manager/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:18

WORKDIR /app

COPY ./src/package*.json ./

COPY ./src/tsconfig*.json ./

RUN npm install

RUN npm install -g typescript

RUN npm install -g ts-node

COPY ./src/app.ts ./

EXPOSE 3000

CMD [ "ts-node", "app.ts" ]
6 changes: 6 additions & 0 deletions backend/components/schema-registry-manager/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build:
docker build -t schema-registry-manager .

release: build
docker tag schema-registry-manager ghcr.io/airyhq/backend/schema-registry-manager:release
docker push ghcr.io/airyhq/backend/schema-registry-manager:release
32 changes: 32 additions & 0 deletions backend/components/schema-registry-manager/helm/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@com_github_airyhq_bazel_tools//helm:helm.bzl", "helm_template_test")
load("//tools/build:helm.bzl", "helm_push_develop", "helm_push_release")

filegroup(
name = "files",
srcs = glob(
["**/*"],
exclude = ["BUILD"],
),
visibility = ["//visibility:public"],
)

pkg_tar(
name = "package",
srcs = [":files"],
extension = "tgz",
strip_prefix = "./",
)

helm_template_test(
name = "template",
chart = ":package",
)

helm_push_develop(
chart = ":package",
)

helm_push_release(
chart = ":package",
)
5 changes: 5 additions & 0 deletions backend/components/schema-registry-manager/helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v2
appVersion: "1.0"
description: Schema registry component to manage different providers
name: schema-registry-manager
version: 1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.component }}
labels:
core.airy.co/managed: "true"
core.airy.co/mandatory: "{{ .Values.mandatory }}"
core.airy.co/component: "{{ .Values.component }}"
annotations:
core.airy.co/enabled: "{{ .Values.enabled }}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.component }}
labels:
app: {{ .Values.component }}
core.airy.co/managed: "true"
core.airy.co/mandatory: "{{ .Values.mandatory }}"
core.airy.co/component: {{ .Values.component }}
spec:
replicas: {{ if .Values.enabled }} 1 {{ else }} 0 {{ end }}
selector:
matchLabels:
app: {{ .Values.component }}
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: {{ .Values.component }}
spec:
containers:
- name: app
image: "ghcr.io/airyhq/{{ .Values.image }}:{{ .Values.imageTag }}"
imagePullPolicy: Always
envFrom:
- configMapRef:
name: security
- configMapRef:
name: kafka-config
- configMapRef:
name: {{ .Values.component }}
env:
- name: KAFKA_TOPIC_NAME
value: {{ .Values.kafka.topic }}
livenessProbe:
httpGet:
path: /actuator/health
port: {{ .Values.port }}
httpHeaders:
- name: Health-Check
value: health-check
initialDelaySeconds: 43200
periodSeconds: 10
failureThreshold: 3
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.component }}
labels:
app: {{ .Values.component }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: {{ .Values.component }}
port: 80
targetPort: {{ .Values.port }}
selector:
app: {{ .Values.component }}
9 changes: 9 additions & 0 deletions backend/components/schema-registry-manager/helm/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
component: schema-registry-manager
mandatory: false
enabled: false
image: backend/schema-registry-manager
imageTag: release
port: 3000
resources:
kafka:
topic: application.communication.messages

0 comments on commit 551539c

Please sign in to comment.