Make builder a proper builder and added healthcheck

This commit is contained in:
Ash Leece 2023-09-15 15:45:53 +01:00
parent fc0b6d1993
commit 376508d4ed
1 changed files with 13 additions and 7 deletions

View File

@ -1,11 +1,17 @@
FROM node:latest as builder
LABEL maintainer="Ash Leece <ash@leece.im>"
ARG VERSION
WORKDIR /data
ENV NODE_OPTIONS=--max_old_space_size=2048
RUN git config --global http.sslVerify false && git clone -b "$VERSION" --depth=1 https://github.com/gchq/CyberChef.git .
RUN npm install && npm run build
FROM busybox:latest
# Get latest version from here https://github.com/gchq/CyberChef/releases
ARG VERSION=v10.5.2
RUN adduser -D -u 1000 cyberchef
USER cyberchef
WORKDIR /data
RUN wget --no-check-certificate https://github.com/gchq/CyberChef/releases/download/$VERSION/CyberChef_$VERSION.zip && \
unzip CyberChef_$VERSION.zip && \
rm CyberChef_$VERSION.zip && \
ln -s ./CyberChef_$VERSION.html ./index.html
ENTRYPOINT ["httpd", "-f", "-p", "8080"]
COPY --from=builder /data/build/prod /data
ENTRYPOINT ["httpd", "-f", "-p", "80"]
COPY healthcheck.sh /healthcheck.sh
HEALTHCHECK --interval=30s --start-period=5s CMD /bin/sh /healthcheck.sh