From looking at the docker compose docs, I am not sure two command options would work. From looking at the result I reckon that’s not the case but I am not overly familiar with docker compose. Docker itself only accepts the last CMD.
So my suggestion would be to use the Dockerfile provided in Running Python with n8n - #3 by jan. In your docker compose file you then replace image: n8nio/n8n
with build: .
(assuming Dockerfile and docker compose file are in the same directory) and get rid of both command
options. I’ve just tried running docker compose up --force-recreate --build
with this config and can now use python3
as expected:
Hope this helps!