Skip to content

Commit

Permalink
feat: improve custom scripts to match other repos
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas committed Dec 1, 2023
1 parent 256ae15 commit 70c684a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ FROM jetty:9.4-jre11
LABEL "Organization"="geOrchestra"
LABEL "Description"="CAS server webapp"

USER root
RUN mkdir -p /docker-entrypoint.d
RUN chown jetty:jetty /docker-entrypoint.d
USER jetty

RUN java -jar "$JETTY_HOME/start.jar" --create-startd --add-to-start=jmx,jmx-remote,stats,gzip,http-forwarded

VOLUME [ "/tmp", "/run/jetty" ]
Expand All @@ -11,7 +16,6 @@ EXPOSE 8080

COPY --chown=jetty:jetty build/cas /var/lib/jetty/webapps/cas
COPY --chown=jetty:jetty docker-entrypoint.sh /
COPY --chown=jetty:jetty docker-entrypoint.d /docker-entrypoint.d/

ENV XMS=256M XMX=1G

Expand Down
11 changes: 0 additions & 11 deletions docker-entrypoint.d/100-execute-custom-scripts.sh

This file was deleted.

9 changes: 9 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

DIR=/docker-entrypoint.d

# Executing custom scripts located in CUSTOM_SCRIPTS_DIRECTORY if environment variable is set
if [[ -z "${CUSTOM_SCRIPTS_DIRECTORY}" ]]; then
echo "[INFO] No CUSTOM_SCRIPTS_DIRECTORY env variable set"
else
echo "[INFO] CUSTOM_SCRIPTS_DIRECTORY env variable set to ${CUSTOM_SCRIPTS_DIRECTORY}"
cp -v "${CUSTOM_SCRIPTS_DIRECTORY}"/* "$DIR"
echo "[INFO] End copying custom scripts"
fi

if [[ -d "$DIR" ]]
then
# Regex is needed to execute all kind of files, including sh files. Warning : --regex not available in alpine images.
Expand Down

0 comments on commit 70c684a

Please sign in to comment.