Per the postgres docker-compose.yml example, near the bottom is the following:
# Wait 5 seconds to start n8n to make sure that PostgreSQL is ready # when n8n tries to connect to it command: /bin/sh -c "sleep 5; n8n start"
I’m no expert on it, but wouldn’t it work to do:
depends_on: - db
I don’t know if you would still need:
command: /bin/sh -c “n8n start”
…or if you could bake that in, but it would be cleaner and more steamlined if the image was set to automatically start. (And probably following best practices)