Skip to content

Commit

Permalink
Merge pull request #8 from georchestra/backport-scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas authored Dec 6, 2023
2 parents 50b64c2 + df3bfbb commit bcd6585
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile-ogc-api-records
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ EXPOSE 8080

ENV JAVA_OPTS=

COPY docker/ /
RUN mkdir -p /docker-entrypoint.d
ENTRYPOINT [ "/docker-entrypoint.sh" ]

ADD ./modules/services/ogc-api-records/target/gn-ogc-api-records.jar /opt/app/gn-ogc-api-records.jar

CMD exec java $JAVA_OPTS -jar /opt/app/gn-ogc-api-records.jar
20 changes: 20 additions & 0 deletions docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

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.
/bin/run-parts --verbose "$DIR" --regex='.*'
fi

exec "$@"

0 comments on commit bcd6585

Please sign in to comment.