Python script through `execute command`

So to use Python on my own instance I am using a Dockerfile like this:

FROM n8nio/n8n:latest

ENV PYTHONUNBUFFERED=1
RUN apk add --update --no-cache python3 curl
RUN python3 -m ensurepip
RUN pip3 install --no-cache --upgrade pip setuptools
RUN pip3 install speedtest-cli

My docker-compose.yml file in the same directory then defines n8n like so:

services:
  n8n:
    build: .
    restart: unless-stopped
    environment:
      ...

Now when I run docker pull n8nio/n8n:latest && docker compose build I am building a custom version of n8n including Python:

3 Likes