2019-06-23 03:35:23 -07:00
|
|
|
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: n8n
|
|
|
|
restart: always
|
2019-07-21 10:47:41 -07:00
|
|
|
environment:
|
|
|
|
- DB_TYPE=mongodb
|
|
|
|
- DB_MONGODB_CONNECTION_URL=mongodb://n8nuser:${MONGO_NON_ROOT_PASSWORD}@mongo:27017/${MONGO_INITDB_DATABASE}
|
2019-06-23 03:35:23 -07:00
|
|
|
ports:
|
|
|
|
- 5678:5678
|
|
|
|
links:
|
|
|
|
- mongo
|
|
|
|
volumes:
|
|
|
|
- ~/.n8n:/root/.n8n
|
|
|
|
# Wait 5 seconds to start n8n to make sure that MongoDB is ready
|
2019-06-23 03:45:36 -07:00
|
|
|
# when n8n tries to connect to it
|
2019-07-21 10:47:41 -07:00
|
|
|
command: /bin/sh -c "sleep 5; n8n start"
|