Skip to content

Instantly share code, notes, and snippets.

@JaniKibichi
JaniKibichi / Dockerfile
Last active February 26, 2022 11:57
Dockerfile for Localhost with SBT
FROM debian:buster
ENV DEBIAN_FRONTEND noninteractive
LABEL JaniKibichi <[email protected]>
#ENSURE SYSTEM IS UP-TO-DATE:
RUN echo '\n\nENSURE SYSTEM IS UP-TO-DATE =======================================\n\n'
RUN apt-get update && apt-get upgrade
#INSTALL OPENJDK-11-JDK
@JaniKibichi
JaniKibichi / languagemenu.json
Created July 1, 2021 09:04
The Language Menu JSON
{
"language": "EN",
"menucontent": [
{
"title": "CON Welcome to BBOXX",
"body": "To Continue, Choose an Account:",
"state": "ChooseAccount",
"language": "EN"
}
],
@JaniKibichi
JaniKibichi / deployment.yaml
Created July 1, 2021 07:41
Deployment with Firebase secrets
apiVersion: apps/v1
kind: Deployment
metadata:
name: ussd-deployment
labels:
app: ussd
spec:
replicas: 1
selector:
matchLabels:
@JaniKibichi
JaniKibichi / cloudbuild.yaml
Created June 30, 2021 10:05
Cloudbuild file for ussd
steps:
# build the container image
- name: "gcr.io/cloud-builders/docker"
args: ["build", "-t", "gcr.io/smart-surf-285319/ussdapi", "."]
# push container image
- name: "gcr.io/cloud-builders/docker"
args: ["push", "gcr.io/smart-surf-285319/ussdapi"]
# deploy container image to GKE
@JaniKibichi
JaniKibichi / ingressupdate.yaml
Created June 30, 2021 09:40
Ingress update for ussd
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: ussd-ingress
annotations:
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
tls:
- hosts:
@JaniKibichi
JaniKibichi / ingress.yaml
Created June 30, 2021 09:37
Ingress for ussd
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: ussd-ingress
annotations:
kubernetes.io/ingress.class: nginx
spec:
rules:
- host: "utility.ussd.janikibichi.com"
http:
@JaniKibichi
JaniKibichi / productionissuer.yaml
Created June 30, 2021 09:33
Production issuer for utility.ussd.janikibichi.com
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
# Email address used for ACME registration
email: [email protected]
server: https://acme-v02.api.letsencrypt.org/directory
privateKeySecretRef:
@JaniKibichi
JaniKibichi / horizontalpodautoscaler.yaml
Created June 30, 2021 09:10
Horizontal pod autoscaler for ussd
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: ussd-horizontal-pod-autoscaler
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: ussd-deployment
minReplicas: 1
@JaniKibichi
JaniKibichi / service.yaml
Created June 30, 2021 09:03
Service for ussd
apiVersion: v1
kind: Service
metadata:
name: ussd-service
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 7500
selector:
@JaniKibichi
JaniKibichi / Dockerfile
Created June 30, 2021 08:52
sbt native packager generated
FROM openjdk:8 as stage0
LABEL snp-multi-stage="intermediate"
LABEL snp-multi-stage-id="52ff43b3-42bb-43db-a05f-231396a6736c"
WORKDIR /opt/docker
COPY 1/opt /1/opt
COPY 2/opt /2/opt
USER root
RUN ["chmod", "-R", "u=rX,g=rX", "/1/opt/docker"]
RUN ["chmod", "-R", "u=rX,g=rX", "/2/opt/docker"]
RUN ["chmod", "u+x,g+x", "/1/opt/docker/bin/utility-ussd"]