Compare commits

..

1 Commits

Author SHA1 Message Date
f1a488d362 Merge pull request 'V4 - Build and Deploy' (#10) from build-and-deploy into master
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m19s
Reviewed-on: #10
2025-06-10 01:58:11 +02:00
4 changed files with 14 additions and 86 deletions

View File

@@ -1,34 +1,22 @@
# Starting from node # Starting from node
FROM node:22-slim FROM node:22-alpine
# Install build dependencies
RUN apt-get update && \
apt-get install -y ffmpeg python3 make g++
# Set the working directory
WORKDIR /app
RUN chown node:node ./
USER node
# Copy package files first
COPY --chown=node:node package.json package-lock.json* .
# Install app dependencies
ENV NODE_ENV=production ENV NODE_ENV=production
WORKDIR /app
RUN apk add --no-cache ffmpeg python3 make g++
# Copy package files and install only production dependencies
COPY package.json package-lock.json* .
RUN npm ci --only=production --ignore-scripts && \ RUN npm ci --only=production --ignore-scripts && \
npm install bufferutil zlib-sync && \ npm install bufferutil zlib-sync
npm cache clean --force
# Copy the builded files # Copy the builded files and the charts
COPY --chown=node:node ./dist/* . COPY ./dist/* .
# Return to root user to remove build dependencies # Set the permissions
USER root RUN chown -R node:node /app
RUN apt-get remove -y python3 make g++ && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
# Go back to node user
USER node USER node
# Start the application # Start the application

View File

@@ -1,32 +0,0 @@
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}
annotations:
external-dns.alpha.kubernetes.io/target: omegamaestro.{{ .Values.ingress.domain }}
cert-manager.io/cluster-issuer: {{ .Values.ingress.issuer }}
nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
{{- if .Values.ingress.geoip }}
nginx.ingress.kubernetes.io/server-snippet: |
if ($lan = yes) { set $allowed_country yes; }
if ($allowed_country = no) { return 451; }
{{- end }}
spec:
ingressClassName: {{ .Values.ingress.class }}
tls:
- hosts:
- {{ .Values.ingress.subdomain }}.{{ .Values.ingress.domain }}
secretName: {{ .Release.Name }}-tls
rules:
- host: "{{ .Values.ingress.subdomain }}.{{ .Values.ingress.domain }}"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: "{{ .Release.Name }}-{{ .Values.service.name }}"
port:
name: {{ .Values.service.name }}
{{- end }}

View File

@@ -1,15 +0,0 @@
{{- if .Values.service.enabled }}
apiVersion: v1
kind: Service
metadata:
name: "{{ .Release.Name }}-{{ .Values.service.name }}"
spec:
selector:
pod: {{ .Release.Name }}
ports:
- name: {{ .Values.service.name }}
port: {{ .Values.deployment.env.TWURPLE_PORT | default .Values.service.port }}
targetPort: {{ .Values.deployment.env.TWURPLE_PORT | default .Values.service.port }}
protocol: TCP
type: {{ .Values.service.type }}
{{- end }}

View File

@@ -15,17 +15,4 @@ deployment:
# Memory: "500Mi" # Memory: "500Mi"
requests: requests:
Cpu: "0.1" Cpu: "0.1"
Memory: "50Mi" Memory: "50Mi"
service:
enabled: true
type: ClusterIP
name: twurple
ingress:
enabled: true
class: nginx
subdomain: dcb-chantier.prd
domain: angels-dev.fr
issuer: letsencrypt-prod
geoip: false