I’m running n8n on Railway (Primary + Worker + Postgres + Redis, using queue mode) and wanted to customize the Dockerfile to add tools like curl
and ffmpeg
.
After switching from the default n8nio/n8n
image to a custom Dockerfile (as suggested in the docs), I ran into problems:
- Login fails with
column User.apiKey does not exist
- Looks like migrations aren’t running
- Redis sometimes fails to connect in Worker mode
When I don’t use a Dockerfile (Railway default), everything works fine.
My Questions:
- Do both Primary and Worker need the Dockerfile separately?
- Can I use one Dockerfile for both and control behavior via
N8N_ROLE
? - How do I make sure
n8n migrate:up
runs in Primary? - Why does login break after switching to Docker?
Would love a clear example or best practice for custom Docker on Railway. Thanks!