mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-04-29 19:58:52 +00:00

create builder for cyberchef and elasticvue based on respective masters builders will build webapps and copy output to nginx html folder as tgz some tweaking for elasticvue to properly load original favicon with cyberchef now run as nginx webapp we gain another 40MB of RAM while webapps will be built on AMD64 all final docker images can now be built as multi arch images for AMD64 and ARM64
21 lines
945 B
Docker
21 lines
945 B
Docker
FROM node:14.18-alpine AS builder
|
|
#
|
|
# Prep and build Elasticvue
|
|
RUN apk -U --no-cache add git && \
|
|
git clone https://github.com/cars10/elasticvue /opt/src && \
|
|
# We need to adjust consts.js so the user has connection suggestion for reverse proxied ES
|
|
sed -i "s#export const DEFAULT_HOST = 'http://localhost:9200'#export const DEFAULT_HOST = window.location.origin + '/es'#g" /opt/src/src/consts.js && \
|
|
sed -i 's#href="/images/logo/favicon.ico"#href="images/logo/favicon.ico"#g' /opt/src/public/index.html && \
|
|
mkdir /opt/app && \
|
|
cd /opt/app && \
|
|
cp /opt/src/package.json . && \
|
|
cp /opt/src/yarn.lock . && \
|
|
yarn install && \
|
|
cp -R /opt/src/* . && \
|
|
# We need to set this ENV so we can run Elasticvue in its own location rather than /
|
|
VUE_APP_PUBLIC_PATH=/elasticvue/ yarn build && \
|
|
cd dist && \
|
|
tar cvfz esvue.tgz *
|
|
#
|
|
FROM scratch AS exporter
|
|
COPY --from=builder /opt/app/dist/esvue.tgz /
|