Compare commits
2 Commits
build_2025
...
build_2025
| Author | SHA1 | Date | |
|---|---|---|---|
|
0cc81d6430
|
|||
|
1dcb8c6826
|
@@ -1,27 +1,34 @@
|
|||||||
# Starting from node
|
# Starting from node
|
||||||
FROM node:22-slim
|
FROM node:22-slim
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
# Install build dependencies
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y ffmpeg python3 make g++
|
||||||
|
|
||||||
|
# Set the working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
RUN chown node:node ./
|
||||||
|
USER node
|
||||||
|
|
||||||
# Copy package files first
|
# Copy package files first
|
||||||
COPY package.json package-lock.json* .
|
COPY --chown=node:node package.json package-lock.json* .
|
||||||
|
|
||||||
# Install build dependencies, compile native modules, then remove build tools
|
# Install app dependencies
|
||||||
RUN apt-get update && \
|
ENV NODE_ENV=production
|
||||||
apt-get install -y ffmpeg python3 make g++ && \
|
RUN npm ci --only=production --ignore-scripts && \
|
||||||
npm ci --only=production --ignore-scripts && \
|
|
||||||
npm install bufferutil zlib-sync && \
|
npm install bufferutil zlib-sync && \
|
||||||
apt-get remove -y python3 make g++ && \
|
npm cache clean --force
|
||||||
|
|
||||||
|
# Copy the builded files
|
||||||
|
COPY --chown=node:node ./dist/* .
|
||||||
|
|
||||||
|
# Return to root user to remove build dependencies
|
||||||
|
USER root
|
||||||
|
RUN apt-get remove -y python3 make g++ && \
|
||||||
apt-get autoremove -y && \
|
apt-get autoremove -y && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy the builded files and the charts
|
# Go back to node user
|
||||||
COPY ./dist/* .
|
|
||||||
|
|
||||||
# Set the permissions
|
|
||||||
RUN chown -R node:node /app
|
|
||||||
USER node
|
USER node
|
||||||
|
|
||||||
# Start the application
|
# Start the application
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ kind: Service
|
|||||||
metadata:
|
metadata:
|
||||||
name: "{{ .Release.Name }}-{{ .Values.service.name }}"
|
name: "{{ .Release.Name }}-{{ .Values.service.name }}"
|
||||||
spec:
|
spec:
|
||||||
type: {{ .Values.service.type }}
|
selector:
|
||||||
|
pod: {{ .Release.Name }}
|
||||||
ports:
|
ports:
|
||||||
- name: {{ .Values.service.name }}
|
- name: {{ .Values.service.name }}
|
||||||
port: {{ .Values.deployment.env.TWURPLE_PORT | default .Values.service.port }}
|
port: {{ .Values.deployment.env.TWURPLE_PORT | default .Values.service.port }}
|
||||||
targetPort: {{ .Values.deployment.env.TWURPLE_PORT | default .Values.service.port }}
|
targetPort: {{ .Values.deployment.env.TWURPLE_PORT | default .Values.service.port }}
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
selector:
|
type: {{ .Values.service.type }}
|
||||||
{{ .Release.Name }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
Reference in New Issue
Block a user