diff --git a/images/layered/Containerfile b/images/layered/Containerfile index 7482280c..cf10c2cc 100644 --- a/images/layered/Containerfile +++ b/images/layered/Containerfile @@ -46,8 +46,21 @@ VOLUME [ \ USER root # This entrypoint script link build assets of the image to the mounted sites volume at container initialization -COPY resources/core/main-entrypoint.sh /usr/local/bin/entrypoint.sh -RUN chmod +x /usr/local/bin/entrypoint.sh +RUN cat <<'EOF' > /usr/local/bin/entrypoint.sh \ + && chmod +x /usr/local/bin/entrypoint.sh +#!/bin/bash +set -e + +ASSETS_PATH="/home/frappe/frappe-bench/sites/assets" +BAKED_PATH="/home/frappe/frappe-bench/assets" + +echo "Linking fresh assets to volume..." +rm -rf "$ASSETS_PATH" +mkdir -p "$(dirname "$ASSETS_PATH")" +ln -s "$BAKED_PATH" "$ASSETS_PATH" + +exec "$@" +EOF USER frappe ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]