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