From 093cd5c53fece9bd381b41051b42797d9052b486 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 22 May 2025 12:49:38 -0700 Subject: [PATCH] fix(docker): fix when we copy and chmod the entrypoint for rootless images --- apps/server/Dockerfile.alpine.rootless | 7 +++---- apps/server/Dockerfile.rootless | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/apps/server/Dockerfile.alpine.rootless b/apps/server/Dockerfile.alpine.rootless index 11946e78b..e161e5473 100644 --- a/apps/server/Dockerfile.alpine.rootless +++ b/apps/server/Dockerfile.alpine.rootless @@ -24,6 +24,9 @@ RUN apk add --no-cache dumb-init && \ WORKDIR /home/${USER}/app COPY ./dist /home/${USER}/app +# Also copy the rootless entrypoint script +COPY rootless-entrypoint.sh /home/${USER}/app/ +RUN chmod +x /home/${USER}/app/rootless-entrypoint.sh RUN rm -rf /home/${USER}/app/node_modules/better-sqlite3 COPY --from=builder /usr/src/app/node_modules/better-sqlite3 /home/${USER}/app/node_modules/better-sqlite3 RUN chown -R ${USER}:${USER} /home/${USER} @@ -41,10 +44,6 @@ ENV TRILIUM_DATA_DIR=/home/${USER}/trilium-data # Use dumb-init as entrypoint to handle signals properly ENTRYPOINT ["/usr/bin/dumb-init", "--"] -# Copy the entrypoint script -COPY rootless-entrypoint.sh /home/${USER}/app/ -RUN chmod +x /home/${USER}/app/rootless-entrypoint.sh - # Use the entrypoint script CMD ["/home/${USER}/app/rootless-entrypoint.sh"] diff --git a/apps/server/Dockerfile.rootless b/apps/server/Dockerfile.rootless index 950ccee46..a08f648c0 100644 --- a/apps/server/Dockerfile.rootless +++ b/apps/server/Dockerfile.rootless @@ -26,6 +26,9 @@ RUN rm -rf \ WORKDIR /home/${USER}/app COPY ./dist /home/${USER}/app +# Also copy the rootless entrypoint script +COPY rootless-entrypoint.sh /home/${USER}/app/ +RUN chmod +x /home/${USER}/app/rootless-entrypoint.sh RUN rm -rf /home/${USER}/app/node_modules/better-sqlite3 COPY --from=builder /usr/src/app/node_modules/better-sqlite3 /home/${USER}/app/node_modules/better-sqlite3 RUN chown -R ${USER}:${USER} /home/${USER} @@ -40,10 +43,6 @@ ENV TRILIUM_UID=${UID} ENV TRILIUM_GID=${GID} ENV TRILIUM_DATA_DIR=/home/${USER}/trilium-data -# Copy the entrypoint script -COPY rootless-entrypoint.sh /home/${USER}/app/ -RUN chmod +x /home/${USER}/app/rootless-entrypoint.sh - # Use the entrypoint script CMD ["/home/${USER}/app/rootless-entrypoint.sh"]