I’ve been running n8n in a docker container locally on Windows using docker desktop. I use docker compose to bring the container up and work on my workflows.
The problem is I wanted to use a packages.json file to install community nodes and then have the dockerfile copy over the packages.json file and run NPM install when it builds the image. I wanted to do it this way instead of through the UI so I can version control the nodes that get installed so it’s easily reproducible to spin up another instance. However when I installed a package, it seems to have maybe uninstalled some core nodes of n8n because now every node in my workflows are all question marks. Even core nodes like split and merge are question marks.
I’ve tried deleting my container and also deleting the volume and rebuilding without the packages.json file stuff containing the new community node I was trying to add but something is still messed up because I still have all of those question marks on all of the nodes. Has anyone run into this before?
docker-compose.yml:
volumes:
db_storage:
n8n_storage:
redis_storage:
x-shared: &shared
restart: always
build: .
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=${POSTGRES_DB}
- DB_POSTGRESDB_USER=${POSTGRES_NON_ROOT_USER}
- DB_POSTGRESDB_PASSWORD=${POSTGRES_NON_ROOT_PASSWORD}
- EXECUTIONS_MODE=queue
- QUEUE_BULL_REDIS_HOST=redis
- QUEUE_HEALTH_CHECK_ACTIVE=true
- N8N_ENCRYPTION_KEY=${ENCRYPTION_KEY}
- N8N_HOST=${N8N_HOST:-localhost}
- N8N_PORT=5678
- N8N_PROTOCOL=${N8N_PROTOCOL:-http}
- NODE_ENV=${NODE_ENV:-production}
- WEBHOOK_URL=${WEBHOOK_URL:-http://localhost:5678/}
- GENERIC_TIMEZONE=${GENERIC_TIMEZONE:-America/New_York}
- EXECUTIONS_DATA_PRUNE=${EXECUTIONS_DATA_PRUNE:-true}
- EXECUTIONS_DATA_MAX_AGE=${EXECUTIONS_DATA_MAX_AGE:-168}
- EXECUTIONS_DATA_PRUNE_MAX_COUNT=${EXECUTIONS_DATA_PRUNE_MAX_COUNT:-50000}
- N8N_COMMUNITY_PACKAGES_ENABLED=${N8N_COMMUNITY_PACKAGES_ENABLED:-true}
- NODES_INCLUDE=["n8n-nodes-globals","n8n-nodes-ffmpeg"]
links:
- postgres
- redis
volumes:
- n8n_storage:/home/node/.n8n
- ./local-files:/files
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
services:
postgres:
image: postgres:16
restart: always
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
- POSTGRES_NON_ROOT_USER
- POSTGRES_NON_ROOT_PASSWORD
volumes:
- db_storage:/var/lib/postgresql/data
- ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
healthcheck:
test: ['CMD-SHELL', 'pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}']
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
restart: always
volumes:
- redis_storage:/data
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 5s
retries: 10
n8n:
<<: *shared
ports:
- "5678:5678"
n8n-worker:
<<: *shared
command: worker
depends_on:
- n8n
Dockerfile:
FROM docker.n8n.io/n8nio/n8n:latest
USER root
RUN apk add --no-cache \
curl \
git \
ffmpeg \
openssh-client \
ca-certificates \
&& update-ca-certificates
COPY package.json /home/node/.n8n/nodes/package.json
RUN cd /home/node/.n8n/nodes && \
npm install && \
chown -R node:node /home/node/.n8n
USER node
WORKDIR /home/node
EXPOSE 5678
ENTRYPOINT ["n8n"]
CMD []
package.json:
{
"dependencies": {
"n8n-nodes-ffmpeg": "0.1.4",
"n8n-nodes-globals": "1.1.0"
},
"scripts": {
"start": "docker compose up -d && echo 'n8n is available at http://localhost:5678'",
"stop": "docker compose down",
"update": "docker compose pull && docker compose down && docker compose up -d",
"restart": "docker compose restart n8n n8n-worker",
"rebuild": "docker compose build && docker compose down && docker compose up -d",
"status": "docker compose ps",
"logs": "docker compose logs -f n8n",
"logs:worker": "docker compose logs -f n8n-worker",
"logs:all": "docker compose logs -f"
}
}
Information on your n8n setup
- n8n version: 1.111.1
- Database (default: SQLite): pgSQL (separate docker container)
- n8n EXECUTIONS_PROCESS setting (default: own, main): ssss
- Running n8n via Docker
- Operating system: Windows 11
