Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .circleci/build/build.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM node:18.18-alpine

# runtime args and environment variables
ARG DIST=RedisInsight.tar.gz
ARG NODE_ENV=production
ARG RI_SEGMENT_WRITE_KEY
ENV RI_SEGMENT_WRITE_KEY=${RI_SEGMENT_WRITE_KEY}
ENV NODE_ENV=${NODE_ENV}
ENV RI_SERVE_STATICS=true
ENV RI_BUILD_TYPE='DOCKER_ON_PREMISE'
ENV RI_APP_FOLDER_ABSOLUTE_PATH='/data'

# this resolves CVE-2023-5363
# TODO: remove this line once we update to base image that doesn't have this vulnerability
RUN apk update && apk upgrade --no-cache libcrypto3 libssl3

# set workdir
WORKDIR /usr/src/app

# copy artifacts built in previous stage to this one
ADD $DIST /usr/src/app/redisinsight
RUN ls -la /usr/src/app/redisinsight

# folder to store local database, plugins, logs and all other files
RUN mkdir -p /data && chown -R node:node /data

# copy the docker entry point script and make it executable
COPY --chown=node:node ./docker-entry.sh ./
RUN chmod +x docker-entry.sh

# since RI is hard-code to port 5000, expose it from the container
EXPOSE 5000

# don't run the node process as root
USER node

# serve the application 🚀
ENTRYPOINT ["./docker-entry.sh", "node", "redisinsight/api/dist/src/main"]
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,25 @@
set -e

PLATFORM=${PLATFORM:-'linux'}
ELECTRON_VERSION=$(cat electron/version)
ARCH=${ARCH:-'x64'}
LIBC=${LIBC:-''}
#FILENAME="RedisInsight-$PLATFORM.$VERSION.$ARCH.zip"
FILENAME="RedisInsight-web-$PLATFORM.$ARCH.tar.gz"
FILENAME="RedisInsight-web-$PLATFORM"
if [ ! -z $LIBC ]
then
FILENAME="$FILENAME-$LIBC.$ARCH.tar.gz"
export npm_config_target_libc="$LIBC"
else
FILENAME="$FILENAME.$ARCH.tar.gz"
fi

echo "Building node modules..."
echo "Platform: $PLATFORM"
echo "Arch: $ARCH"
echo "Libc: $LIBC"
echo "npm target libc: $npm_config_target_libc"
echo "Filname: $FILENAME"

# reinstall backend prod dependencies only (optimise space)
rm -rf redisinsight/api/node_modules

npm_config_arch="$ARCH" \
Expand All @@ -23,13 +36,13 @@ rm -rf redisinsight/build.zip

cp LICENSE ./redisinsight

cd redisinsight && tar -czvf build.tar.gz \
cd redisinsight && tar -czf build.tar.gz \
--exclude="api/node_modules/**/build/node_gyp_bins/python3" \
api/node_modules \
api/dist \
ui/dist \
LICENSE \
&& cd ..

mkdir -p release/redisstack
cp redisinsight/build.tar.gz release/redisstack/"$FILENAME"
mkdir -p release/web
cp redisinsight/build.tar.gz release/web/"$FILENAME"
3 changes: 3 additions & 0 deletions .circleci/build/manual-build-validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const whitelist = {
'windows': {
'nsis': 1,
'nsis:x64': 1,
},
'docker': {
'all': 1,
}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e

cd ./release/redisstack
cd ./release/web

for f in *.tar.gz; do
sha256sum "$f" > "$f.sha256"
Expand Down
Loading