From 866bc2ed9e926b04ecb018c6524b779e43e16ad4 Mon Sep 17 00:00:00 2001 From: Cameron Redmore Date: Fri, 18 Apr 2025 16:51:10 +0100 Subject: [PATCH] Add entrypoint to allow file override. --- Dockerfile | 5 +++++ entrypoint.sh | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index a56bdf3..2a19b1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,8 @@ FROM nginx:latest COPY www /usr/share/nginx/html +COPY entrypoint.sh /entrypoint.sh + +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..ad700c0 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Check if the folder /extra exists, if so, copy all files from /extra to /usr/share/nginx/html +if [ -d "/extra" ]; then + echo "Copying files from /extra to /usr/share/nginx/html" + cp -r /extra/* /usr/share/nginx/html/ +fi + +echo "Executing command: $@" +exec "$@" \ No newline at end of file