mirror of
https://github.com/preparebuddyy/n8n-self-hosted.git
synced 2026-03-03 02:57:01 +00:00
add external network and services
This commit is contained in:
25
README.md
25
README.md
@@ -30,21 +30,27 @@ This repository provides a Docker Compose setup for running a self-hosted n8n in
|
|||||||
cd n8n-self-hosted
|
cd n8n-self-hosted
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Configure the environment:**
|
2. **Create the shared network:**
|
||||||
|
This setup uses a shared network to easily connect to external databases. If you haven't already, create the network:
|
||||||
|
```bash
|
||||||
|
docker network create shared_network
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Configure the environment:**
|
||||||
Open the `.env` file and update the variables with your own settings.
|
Open the `.env` file and update the variables with your own settings.
|
||||||
|
|
||||||
3. **Start the application:**
|
4. **Start the application:**
|
||||||
```bash
|
```bash
|
||||||
./start-docker.sh
|
./start-docker.sh
|
||||||
```
|
```
|
||||||
This will start all the services in detached mode and scale the `n8n-worker` service to 2 replicas.
|
This will start all the services in detached mode and scale the `n8n-worker` service to 2 replicas.
|
||||||
|
|
||||||
4. **Restart the application:**
|
5. **Restart the application:**
|
||||||
```bash
|
```bash
|
||||||
./restart-docker.sh
|
./restart-docker.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
5. **Update the application:**
|
6. **Update the application:**
|
||||||
```bash
|
```bash
|
||||||
./update-docker.sh
|
./update-docker.sh
|
||||||
```
|
```
|
||||||
@@ -60,6 +66,17 @@ To create a backup, run:
|
|||||||
```
|
```
|
||||||
This will create a compressed SQL dump of your PostgreSQL database in the `local_files/backups/` directory. It is recommended to run this script regularly (e.g., using a cron job).
|
This will create a compressed SQL dump of your PostgreSQL database in the `local_files/backups/` directory. It is recommended to run this script regularly (e.g., using a cron job).
|
||||||
|
|
||||||
|
## Connecting to External Databases
|
||||||
|
|
||||||
|
This n8n setup is part of a larger ecosystem of self-hosted services that can all run on the same `shared_network`. This allows n8n to securely connect to them using their container names as hostnames.
|
||||||
|
|
||||||
|
Check out these pre-configured databases that work out-of-the-box with this n8n instance:
|
||||||
|
|
||||||
|
- [**postgresql-self-hosted**](https://github.com/AiratTop/postgresql-self-hosted): A simple and robust PostgreSQL setup.
|
||||||
|
- [**mysql-self-hosted**](https://github.com/AiratTop/mysql-self-hosted): A self-hosted MySQL instance.
|
||||||
|
- [**clickhouse-self-hosted**](https://github.com/AiratTop/clickhouse-self-hosted): High-performance columnar database for analytics.
|
||||||
|
- [**qdrant-self-hosted**](https://github.com/AiratTop/qdrant-self-hosted): A vector database for AI applications.
|
||||||
|
|
||||||
## Services
|
## Services
|
||||||
|
|
||||||
- `caddy`: Reverse proxy
|
- `caddy`: Reverse proxy
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ BACKUP_DIR="local_files/backups"
|
|||||||
mkdir -p "${BACKUP_DIR}"
|
mkdir -p "${BACKUP_DIR}"
|
||||||
|
|
||||||
# Dump the PostgreSQL database and compress it.
|
# Dump the PostgreSQL database and compress it.
|
||||||
docker-compose exec -T n8n-psql pg_dump -U n8n -d n8n_db | gzip > "${BACKUP_DIR}/psql_n8ndb_$(date +%F_%H-%M-%S).sql.gz"
|
docker compose exec -T n8n-psql pg_dump -U n8n -d n8n_db | gzip > "${BACKUP_DIR}/psql_n8ndb_$(date +%F_%H-%M-%S).sql.gz"
|
||||||
|
|||||||
@@ -149,3 +149,4 @@ networks:
|
|||||||
shared_network:
|
shared_network:
|
||||||
name: shared_network
|
name: shared_network
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
external: true
|
||||||
Reference in New Issue
Block a user