YAML:
version: "3.8"
services:
n8n:
container_name: n8n-whisper
build:
context: .
dockerfile: Dockerfile
ports:
- "5678:5678"
volumes:
- ./n8n:/home/node/.n8n
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=admin
- N8N_BASIC_AUTH_PASSWORD=123456
restart: unless-stopped
DockerFile:
# 以 Python 為主的 slim Debian base image
FROM python:3.10-slim
# 安裝 Node.js 套件、ffmpeg、git 等
RUN apt-get update && \
apt-get install -y curl ffmpeg git gnupg && \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs && \
npm install -g n8n && \
pip install --no-cache-dir openai-whisper && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# 建立 n8n 用戶
RUN useradd -m -s /bin/bash node
USER node
WORKDIR /home/node
EXPOSE 5678
CMD ["n8n"]
Command line:
docker compose down (關閉容器)
docker compose up (依yaml啟動容器)
(YAML跟DockerFile都是由OpenAI ChatGPT來回溝通後產的(將有效果的存起來)
測試結果如下:
不過很耗本地的CPU資源就是...(M3 Max 16"),跑蠻久的
文章標籤
全站熱搜
