You can find a full example which starts n8n via docker-compose with Postgres here:
Apart from that can the you use the default docker-syntax to set environment variables -e NAME=VALUE as described here in the docker documentation:
Here also a full example for a one-liner with all variables set:
I do not have an example ready with nginx in front of it. But you can combine the above examples with any other docker-example which puts nginx in front of X and you should the be able to get it up and running.
So that works fine with the -e docker options.
Although it isn’t necessary to add in the schema option for the psql connection. TBH, I’ve never had to use that in 20+ years of being a sysadmin.
(and the machine it’s on right now is actually running apache, not nginx)
I might give traefik a go if I move it to its own container.
For my setup it’s more likely that any external webhooks would be coming via haproxy, so I’ll look at that soon.