Update README.md

This commit is contained in:
RipleyBooya 2025-02-21 11:48:40 +01:00 committed by GitHub
parent 31f391ce57
commit 85dab08372
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -46,6 +46,8 @@ docker run -d --name ssh-tunnel \
### **2⃣ Using `docker-compose.yml`** ### **2⃣ Using `docker-compose.yml`**
For easier management, use **Docker Compose**: For easier management, use **Docker Compose**:
#### **2⃣.1️⃣ Using a Custom Network (Recommended)**
```yaml ```yaml
version: '3.8' version: '3.8'
@ -69,6 +71,31 @@ networks:
driver: bridge driver: bridge
``` ```
#### **2⃣.2️⃣ Using Host Network Mode (Alternative)**
If you need the ports to be accessible outside Docker, use `network_mode: host` :
```yaml
version: '3.8'
services:
ssh-tunnel:
image: ripleybooya/ssh-tunnel
container_name: ssh-tunnel
restart: always
network_mode: host # Uses the host network instead of a Docker network
environment:
SSH_HOST: "your-server.com"
SSH_USER: "your-username"
REMOTE_PORTS: "127.0.0.1:5432 127.0.0.1:443"
LOCAL_PORTS: "15432 8443"
volumes:
- /path/to/id_rsa:/tmp/id_rsa:ro
```
📌 Which mode to choose?
- ✅ Custom network (default) → If services are inside Docker.
- ✅ Host mode → If you want to expose the tunnel outside Docker.
--- ---
## 📌 **Why use this image?** ## 📌 **Why use this image?**
@ -151,7 +178,7 @@ This project is open-source and welcomes contributions!
- 🛠 **Source Code & Issues:** [GitHub Repository](https://github.com/RipleyBooya/ssh-tunnel) - 🛠 **Source Code & Issues:** [GitHub Repository](https://github.com/RipleyBooya/ssh-tunnel)
- 🐳 **Docker Hub Page:** [Docker Image](https://hub.docker.com/r/ripleybooya/ssh-tunnel) - 🐳 **Docker Hub Page:** [Docker Image](https://hub.docker.com/r/ripleybooya/ssh-tunnel)
- 🇫🇷 **Version française (WikiJS):** [ltgs.wiki (FR)](https://ltgs.wiki/fr/InfoTech/Virt/Docker/ssh-tunnel) - 🇫🇷 **Version française (WikiJS):** [ltgs.wiki (FR)](https://ltgs.wiki/en/InfoTech/Virt/Docker/ssh-tunnel)
- 🇺🇸 **English version (WikiJS):** [ltgs.wiki (EN)](https://ltgs.wiki/en/InfoTech/Virt/Docker/ssh-tunnel) - 🇺🇸 **English version (WikiJS):** [ltgs.wiki (EN)](https://ltgs.wiki/fr/InfoTech/Virt/Docker/ssh-tunnel)
If you find any issues or have suggestions, feel free to open a GitHub issue or contribute! 🚀 If you find any issues or have suggestions, feel free to open a GitHub issue or contribute! 🚀