mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
⚡ Remove docker-compose exmple as support will be removed #962
This commit is contained in:
parent
2faa862ada
commit
6064aa1a5a
|
@ -1,9 +0,0 @@
|
|||
MONGO_INITDB_ROOT_USERNAME=changeUser
|
||||
MONGO_INITDB_ROOT_PASSWORD=changePassword
|
||||
MONGO_INITDB_DATABASE=n8n
|
||||
|
||||
MONGO_NON_ROOT_USERNAME=changeUser
|
||||
MONGO_NON_ROOT_PASSWORD=changePassword
|
||||
|
||||
N8N_BASIC_AUTH_USER=changeUser
|
||||
N8N_BASIC_AUTH_PASSWORD=changePassword
|
|
@ -1,26 +0,0 @@
|
|||
# n8n with MongoDB
|
||||
|
||||
Starts n8n with MongoDB as database.
|
||||
|
||||
|
||||
## Start
|
||||
|
||||
To start n8n with MongoDB simply start docker-compose by executing the following
|
||||
command in the current folder.
|
||||
|
||||
|
||||
**IMPORTANT:** But before you do that change the default users and passwords in the `.env` file!
|
||||
|
||||
```
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
To stop it execute:
|
||||
|
||||
```
|
||||
docker-compose stop
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
The default name of the database, user and password for MongoDB can be changed in the `.env` file in the current directory.
|
|
@ -1,34 +0,0 @@
|
|||
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"
|
|
@ -1,17 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -e;
|
||||
|
||||
# Create a default non-root role
|
||||
MONGO_NON_ROOT_ROLE="${MONGO_NON_ROOT_ROLE:-readWrite}"
|
||||
|
||||
if [ -n "${MONGO_NON_ROOT_USERNAME:-}" ] && [ -n "${MONGO_NON_ROOT_PASSWORD:-}" ]; then
|
||||
"${mongo[@]}" "$MONGO_INITDB_DATABASE" <<-EOJS
|
||||
db.createUser({
|
||||
user: $(_js_escape "$MONGO_NON_ROOT_USERNAME"),
|
||||
pwd: $(_js_escape "$MONGO_NON_ROOT_PASSWORD"),
|
||||
roles: [ { role: $(_js_escape "$MONGO_NON_ROOT_ROLE"), db: $(_js_escape "$MONGO_INITDB_DATABASE") } ]
|
||||
})
|
||||
EOJS
|
||||
else
|
||||
echo "SETUP INFO: No Environment variables given!"
|
||||
fi
|
Loading…
Reference in a new issue