wiredoor-cli Container as a Gateway for Other Docker Services #70
Replies: 1 comment
-
|
Thank you so much for sharing this detailed guide! You've implemented an excellent and secure variation of the Docker-based gateway pattern we describe in the official docs (Docker Gateway - Wiredoor Docs), and your clear explanation will definitely be helpful to other users in the community. We also appreciate your help with the recent CrowdSec integration, and of course, thank you for your sponsorship 💙. Your support helps us continue improving Wiredoor. If you're interested in contributing, whether it's by providing feedback, improving the documentation or submitting code, you're welcome to do so. We look forward to seeing more of your setups, so feel free to share them anytime. Thanks again for everything! 🙌 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am not sure if the right way to do it, but here is how I am using wiredoor-cli docker container. Hope this little guide will help someone.
Step 1: Create a Gateway on the Wiredoor Server
The first step is to configure a new gateway on your main Wiredoor server. This gateway will represent the network of services you intend to proxy.
172.31.1.0/24for this example, but you can use any private CIDR range that doesn't conflict with your existing networks.wiredoor-cliclient.Step 2: Create a Custom Docker Network on Your Host
On the machine where you will run your services, you need to create a dedicated Docker network. This network must use the same subnet that you defined on the Wiredoor server.
Execute the Docker Command: Open your terminal and run the following command:
This creates a local bridge network named
wiredoor-netthat your containers will connect to.Step 3: Deploy the
wiredoor-cliGateway ContainerNow, deploy the
wiredoor-clicontainer. It will connect to the Wiredoor server and act as the entry point for traffic into your custom Docker network.Create a
docker-compose.ymlfile:Configuration Explained:
networks: wiredoor-net: external: true: This instructs Docker Compose to use thewiredoor-netnetwork that you created manually in the previous step.cap_add: - NET_ADMIN&sysctls: - net.ipv4.ip_forward=1: These permissions are essential. They allow the container to manage network interfaces and forward IP traffic, enabling it to function as a gateway.environment: You must provide your Wiredoor Server URL (WD_URL) and the gateway Token (WD_TOKEN) you copied in Step 1. For security, it is best practice to place these in a.envfile in the same directory.Launch the Container:
Step 4: Deploy Your Services into the Same Network
You can now run other services, like Uptime Kuma, and attach them to the same
wiredoor-net.Add the service to your
docker-compose.yml:Important Note: There is no need to add a
portssection for theuptime-kumaservice. Since it shares a Docker network withwiredoor-gw, the gateway can reach it directly using its container name. This is a more secure approach than exposing ports on the host.Launch the Service:
Step 5: Add the Service Route on the Wiredoor Server
The final step is to tell your Wiredoor server how to route traffic to the new service.
uptime-kuma:3001.Your Uptime Kuma instance is now accessible through the Wiredoor server without being directly exposed to the internet from your host machine. You can repeat Steps 4 and 5 for any other containerized service you wish to proxy.
Beta Was this translation helpful? Give feedback.
All reactions