Running Python with n8n

Just wanted to add on 1 issue i encountered while building the dockerfile,
I got:
ERROR: Unable to lock database: Permission denied
ERROR: Failed to open apk database: Permission denied

to get around it, i modified the dockerfile to
FROM n8nio/n8n
USER root
RUN apk add --update python3 py3-pip

USER root will make sure the container was run as root and all’s well.

1 Like

This is not a good practice.

You should avoid using root.

To solve your issue, use USER in dockerfile:

USER root
Install your package or run your commands

USER n8n # Go back to normal user