mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
fix(docker): Revert docker USER and WORKDIR changes (#3992)
Switching from `root` to another user needs a bit more testing, as we need to figure out how to auto-migrate all existing instances of n8n when people upgrade.
This commit is contained in:
committed by
GitHub
parent
2a539d7849
commit
34a99fd089
@@ -17,10 +17,8 @@ RUN set -eux; \
|
|||||||
find /usr/local/lib/node_modules/n8n -type f -name "*.ts" -o -name "*.js.map" -o -name "*.vue" | xargs rm && \
|
find /usr/local/lib/node_modules/n8n -type f -name "*.ts" -o -name "*.js.map" -o -name "*.vue" | xargs rm && \
|
||||||
rm -rf /root/.npm
|
rm -rf /root/.npm
|
||||||
|
|
||||||
RUN \
|
# Set a custom user to not have n8n run as root
|
||||||
mkdir .n8n && \
|
USER root
|
||||||
chown node:node .n8n && \
|
WORKDIR /data
|
||||||
ln -s /docker-entrypoint.sh /home/node/docker-entrypoint.sh
|
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
USER node
|
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
|
||||||
COPY docker-entrypoint.sh ./
|
|
||||||
ENTRYPOINT ["tini", "--", "./docker-entrypoint.sh"]
|
|
||||||
|
|||||||
@@ -1,8 +1,17 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ -d /root/.n8n ] ; then
|
||||||
|
chmod o+rx /root
|
||||||
|
chown -R node /root/.n8n
|
||||||
|
ln -s /root/.n8n /home/node/
|
||||||
|
fi
|
||||||
|
|
||||||
|
chown -R node /home/node
|
||||||
|
|
||||||
if [ "$#" -gt 0 ]; then
|
if [ "$#" -gt 0 ]; then
|
||||||
# Got started with arguments
|
# Got started with arguments
|
||||||
exec node "$@"
|
exec su-exec node "$@"
|
||||||
else
|
else
|
||||||
# Got started without arguments
|
# Got started without arguments
|
||||||
exec n8n
|
exec su-exec n8n
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user