Skip to content

Commit

Permalink
Change entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
yenienserrano committed Oct 31, 2024
1 parent 4368516 commit bb643d1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
26 changes: 16 additions & 10 deletions dev-tools/build-dev-image/entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/bin/bash
base_path_plugins="/home/node/kbn/plugins"
plugins=$(ls $base_path_plugins)
for plugin in $plugins; do
if [ ! -d "$base_path_plugins/$plugin/node_modules" ]; then
cd $base_path_plugins/$plugin
echo "Installing dependencies for $plugin"
yarn install
fi
done
if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then
base_path_plugins="/home/node/kbn/plugins"
plugins=$(ls $base_path_plugins)
for plugin in $plugins; do
echo "Checking if $plugin has node_modules"
if [ ! -d "$base_path_plugins/$plugin/node_modules" ]; then
cd $base_path_plugins/$plugin
echo "Installing dependencies for $plugin"
yarn install
fi
done
cd /home/node/kbn
yarn start --no-base-path
tail -f /dev/null
fi

tail -f /dev/null
exec "$@"
6 changes: 3 additions & 3 deletions dev-tools/build-dev-image/wzd.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ FROM node:${NODE_VERSION}
USER node
COPY --chown=node:node --from=base /home/node/kbn /home/node/kbn
WORKDIR /home/node/kbn
ADD ./entrypoint.sh /home/node/entrypoint.sh
ADD ./entrypoint.sh /usr/local/bin/entrypoint.sh
USER root
RUN chmod +x /home/node/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
USER node
ENTRYPOINT [ "/home/node/entrypoint.sh" ]
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]

0 comments on commit bb643d1

Please sign in to comment.