mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-17 01:54:06 -08:00
d2b1d7fe6e
MONGO_NON_ROOT_USERNAME specified in .env, but hardcoded n8nuser value used.
35 lines
900 B
YAML
35 lines
900 B
YAML
version: '3.1'
|
|
|
|
services:
|
|
|
|
mongo:
|
|
image: mongo:4.0
|
|
restart: always
|
|
environment:
|
|
- MONGO_INITDB_ROOT_USERNAME
|
|
- MONGO_INITDB_ROOT_PASSWORD
|
|
- MONGO_INITDB_DATABASE
|
|
- MONGO_NON_ROOT_USERNAME
|
|
- MONGO_NON_ROOT_PASSWORD
|
|
volumes:
|
|
- ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
|
|
|
|
n8n:
|
|
image: n8nio/n8n
|
|
restart: always
|
|
environment:
|
|
- DB_TYPE=mongodb
|
|
- DB_MONGODB_CONNECTION_URL=mongodb://${MONGO_NON_ROOT_USERNAME}:${MONGO_NON_ROOT_PASSWORD}@mongo:27017/${MONGO_INITDB_DATABASE}
|
|
- N8N_BASIC_AUTH_ACTIVE=true
|
|
- N8N_BASIC_AUTH_USER
|
|
- N8N_BASIC_AUTH_PASSWORD
|
|
ports:
|
|
- 5678:5678
|
|
links:
|
|
- mongo
|
|
volumes:
|
|
- ~/.n8n:/root/.n8n
|
|
# Wait 5 seconds to start n8n to make sure that MongoDB is ready
|
|
# when n8n tries to connect to it
|
|
command: /bin/sh -c "sleep 5; n8n start"
|