Docker
A straight-forward docker setup.
Install Matey with the Docker backend
If you haven't already, install Matey.
By default, it is configured to work with the local Docker Engine.
Matey will watch your Docker containers and configure your webserver
With the Matey service running and waiting for containers, let's start one!
docker start --label matey.enable=true --label matey.frontend.rule=Host:hello-world.localhost getmatey/hello-world
Tip
You can also use the equivalent docker-compose.yml
:
When Matey sees the service, it configures your webserver to route requests to your container so you can reach it. Let's check it with PowerShell.
Should give you:Container Labels
Label | Description |
---|---|
matey.enabled=true |
Whether Matey should configure the webserver to forward to the container. |
matey.<segment_name>.port=80 |
Sets the container port to which traffic should be forwarded to. |
matey.<segment_name>.weight=50 |
Assigns a weight to the container for load balancing. |
matey.<segment_name>.loadbalancer.stickiness.enabled=true |
Whether to use sticky load balancing for the container. |
matey.<segment_name>.loadbalancer.stickiness.cookieName=_mateyaffinity |
Sets the cookie name to use to track sessions for sticky load balancing. |
matey.<segment_name>.domain=example.com |
Sets the default base domain provided to the frontend rule expression. |
matey.<segment_name>.frontend.rule=Host:api.example.com |
Overrides the frontend rule. Default: Host:{container_name}.{domain} . |