d-ui needs less resources
This commit is contained in:
@@ -6,7 +6,6 @@ metadata:
|
|||||||
labels:
|
labels:
|
||||||
app: registry-ui
|
app: registry-ui
|
||||||
release: docker-registry-ui
|
release: docker-registry-ui
|
||||||
app/version: "1.2.1"
|
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
@@ -48,11 +47,11 @@ spec:
|
|||||||
port: http
|
port: http
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
memory: "24Mi"
|
memory: "10Mi"
|
||||||
cpu: "50m"
|
cpu: "1m"
|
||||||
limits:
|
limits:
|
||||||
memory: "64Mi"
|
memory: "32Mi"
|
||||||
cpu: "100m"
|
cpu: "30m"
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
@@ -61,7 +60,6 @@ metadata:
|
|||||||
labels:
|
labels:
|
||||||
app: registry-ui
|
app: registry-ui
|
||||||
release: docker-registry-ui
|
release: docker-registry-ui
|
||||||
app/version: "1.2.1"
|
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- port: 80
|
- port: 80
|
||||||
|
|||||||
@@ -1,44 +1,17 @@
|
|||||||
# ----------------
|
FROM node:current-buster-slim
|
||||||
# STEP 1:
|
|
||||||
# https://lobradov.github.io/Building-docker-multiarch-images/
|
|
||||||
# Build Openzwave and Zwave2Mqtt pkg
|
|
||||||
# All result files will be put in /dist folder
|
|
||||||
FROM node:8.15.1-alpine AS build
|
|
||||||
|
|
||||||
# Set the commit of Zwave2Mqtt to checkout when cloning the repo
|
# Set the commit of Zwave2Mqtt to checkout when cloning the repo
|
||||||
ENV Z2M_VERSION=9cc3740740b57f1e896139b5ffdb25be7576ad58
|
ENV Z2M_VERSION=9cc3740740b57f1e896139b5ffdb25be7576ad58
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
# Install required dependencies
|
# Install required dependencies
|
||||||
RUN apk update && apk --no-cache add \
|
RUN apt update -y && \
|
||||||
gnutls \
|
apt full-upgrade -y && \
|
||||||
gnutls-dev \
|
apt autoremove -y && \
|
||||||
libusb \
|
apt clean -y
|
||||||
eudev \
|
|
||||||
# Install build dependencies
|
|
||||||
&& apk --no-cache --virtual .build-deps add \
|
|
||||||
coreutils \
|
|
||||||
eudev-dev \
|
|
||||||
build-base \
|
|
||||||
git \
|
|
||||||
python \
|
|
||||||
bash \
|
|
||||||
libusb-dev \
|
|
||||||
linux-headers \
|
|
||||||
wget \
|
|
||||||
tar \
|
|
||||||
openssl \
|
|
||||||
make \
|
|
||||||
socat
|
|
||||||
|
|
||||||
# Build binaries and move them to /dist/lib
|
RUN apt install -y \
|
||||||
RUN cd /root \
|
socat libopenzwave1.5 npm git
|
||||||
&& wget http://old.openzwave.com/downloads/openzwave-1.4.1.tar.gz \
|
|
||||||
&& tar zxvf openzwave-*.gz \
|
|
||||||
&& cd openzwave-* && make && make install \
|
|
||||||
&& mkdir -p /dist/lib \
|
|
||||||
&& mv libopenzwave.so* /dist/lib/
|
|
||||||
|
|
||||||
COPY bin/package.sh /root/package.sh
|
|
||||||
|
|
||||||
# Clone Zwave2Mqtt build pkg files and move them to /dist/pkg
|
# Clone Zwave2Mqtt build pkg files and move them to /dist/pkg
|
||||||
RUN npm config set unsafe-perm true && npm install -g pkg \
|
RUN npm config set unsafe-perm true && npm install -g pkg \
|
||||||
@@ -49,42 +22,20 @@ RUN npm config set unsafe-perm true && npm install -g pkg \
|
|||||||
&& npm install \
|
&& npm install \
|
||||||
&& npm run build
|
&& npm run build
|
||||||
|
|
||||||
RUN cd /root \
|
|
||||||
&& chmod +x package.sh && ./package.sh \
|
|
||||||
&& mkdir -p /dist/pkg \
|
|
||||||
&& mv /root/Zwave2Mqtt/pkg/* /dist/pkg
|
|
||||||
|
|
||||||
# Get last config DB from main repo and move files to /dist/db
|
|
||||||
RUN cd /root \
|
|
||||||
&& git clone https://github.com/OpenZWave/open-zwave.git \
|
|
||||||
&& cd open-zwave \
|
|
||||||
&& mkdir -p /dist/db \
|
|
||||||
&& mv config/* /dist/db
|
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
RUN rm -R /root/* && apk del .build-deps
|
RUN rm -rf /root/* && \
|
||||||
|
apt-get clean -y && \
|
||||||
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
# ----------------
|
|
||||||
# STEP 2:
|
|
||||||
# Run a minimal alpine image
|
|
||||||
FROM alpine:latest
|
|
||||||
|
|
||||||
LABEL maintainer="zoide"
|
|
||||||
|
|
||||||
RUN apk update && apk add --no-cache \
|
|
||||||
libstdc++ \
|
|
||||||
libgcc \
|
|
||||||
libusb \
|
|
||||||
eudev
|
|
||||||
|
|
||||||
# Copy files from previous build stage
|
|
||||||
COPY --from=build /dist/lib/ /lib/
|
COPY --from=build /dist/lib/ /lib/
|
||||||
COPY --from=build /dist/db/ /usr/local/etc/openzwave/
|
|
||||||
COPY --from=build /dist/pkg /usr/src/app
|
COPY --from=build /dist/pkg /usr/src/app
|
||||||
|
|
||||||
# supervisor base configuration
|
# supervisor base configuration
|
||||||
ADD supervisor.conf /etc/supervisor.conf
|
ADD supervisor.conf /etc/supervisor.conf
|
||||||
|
|
||||||
|
LABEL maintainer="zoide"
|
||||||
|
|
||||||
# Set enviroment
|
# Set enviroment
|
||||||
ENV LD_LIBRARY_PATH /lib
|
ENV LD_LIBRARY_PATH /lib
|
||||||
|
|
||||||
@@ -93,6 +44,3 @@ EXPOSE 8091
|
|||||||
CMD ["supervisord", "-c", "/etc/supervisor.conf"]
|
CMD ["supervisord", "-c", "/etc/supervisor.conf"]
|
||||||
#CMD ["/usr/src/app/zwave2mqtt"]
|
#CMD ["/usr/src/app/zwave2mqtt"]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user