fix(docker/rootless): entrypoint if executable bit is not set

This commit is contained in:
Elian Doran 2025-05-27 19:52:30 +03:00
parent a1dda3c01a
commit 02fc5214a3
No known key found for this signature in database
3 changed files with 3 additions and 5 deletions

View File

@ -26,7 +26,6 @@ WORKDIR /home/${USER}/app
COPY ./dist /home/${USER}/app COPY ./dist /home/${USER}/app
# Also copy the rootless entrypoint script # Also copy the rootless entrypoint script
COPY rootless-entrypoint.sh /home/${USER}/app/ 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 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 COPY --from=builder /usr/src/app/node_modules/better-sqlite3 /home/${USER}/app/node_modules/better-sqlite3
RUN chown -R ${USER}:${USER} /home/${USER} RUN chown -R ${USER}:${USER} /home/${USER}
@ -45,6 +44,6 @@ ENV TRILIUM_DATA_DIR=/home/${USER}/trilium-data
ENTRYPOINT ["/usr/bin/dumb-init", "--"] ENTRYPOINT ["/usr/bin/dumb-init", "--"]
# Use the entrypoint script # Use the entrypoint script
CMD /home/${USER}/app/rootless-entrypoint.sh CMD [ "bash", "./rootless-entrypoint.sh" ]
HEALTHCHECK --start-period=10s CMD node /home/${USER}/app/docker_healthcheck.js HEALTHCHECK --start-period=10s CMD node /home/${USER}/app/docker_healthcheck.js

View File

@ -28,7 +28,6 @@ WORKDIR /home/${USER}/app
COPY ./dist /home/${USER}/app COPY ./dist /home/${USER}/app
# Also copy the rootless entrypoint script # Also copy the rootless entrypoint script
COPY rootless-entrypoint.sh /home/${USER}/app/ 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 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 COPY --from=builder /usr/src/app/node_modules/better-sqlite3 /home/${USER}/app/node_modules/better-sqlite3
RUN chown -R ${USER}:${USER} /home/${USER} RUN chown -R ${USER}:${USER} /home/${USER}
@ -44,6 +43,6 @@ ENV TRILIUM_GID=${GID}
ENV TRILIUM_DATA_DIR=/home/${USER}/trilium-data ENV TRILIUM_DATA_DIR=/home/${USER}/trilium-data
# Use the entrypoint script # Use the entrypoint script
CMD /home/${USER}/app/rootless-entrypoint.sh CMD [ "bash", "./rootless-entrypoint.sh" ]
HEALTHCHECK --start-period=10s CMD node /home/${USER}/app/docker_healthcheck.js HEALTHCHECK --start-period=10s CMD node /home/${USER}/app/docker_healthcheck.js

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
# Rootless entrypoint script for Trilium Notes # Rootless entrypoint script for Trilium Notes
# Works with both Debian and Alpine-based images # Works with both Debian and Alpine-based images