mirror of
https://github.com/dokku/dokku.git
synced 2025-12-16 03:57:43 +01:00
Merge pull request #7608 from dragonhunt02/label
Add commands to proxy implementations for managing labels
This commit is contained in:
@@ -5,3 +5,4 @@
|
||||
- Support for the `DOKKU_DOCKERFILE_CACHE_BUILD` environment variable has been removed. Use the `docker-options` plugin to set build arguments for your app instead.
|
||||
- Support for the `DOKKU_DOCKER_BUILD_OPTS` environment variable has been removed. Use the `docker-options` plugin to set build arguments for your app instead.
|
||||
- Support for the `no-cache` nixpacks property has been removed. Use the `docker-options` plugin to set build arguments for your app instead.
|
||||
- Support for customizing the label-key for the caddy proxy has been removed. Always use `caddy.` as a prefix for your caddy directives.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
> [!IMPORTANT]
|
||||
> New as of 0.28.0
|
||||
|
||||
Dokku provides integration with the [Caddy](https://caddyserver.com/) proxy service by utilizing the Docker label-based integration implemented by Caddy.
|
||||
Dokku provides integration with the [Caddy](https://caddyserver.com/) proxy service by utilizing the Docker label-based integration implemented by [Caddy Docker Proxy](https://github.com/lucaslorentz/caddy-docker-proxy).
|
||||
|
||||
```
|
||||
caddy:report [<app>] [<flag>] # Displays a caddy report for one or more apps
|
||||
@@ -117,15 +117,53 @@ dokku caddy:set --global log-level DEBUG
|
||||
|
||||
After modifying, the Caddy container will need to be restarted.
|
||||
|
||||
### Changing the label key for the app
|
||||
### Label Management
|
||||
|
||||
The default label key for the app is `caddy`. This can be changed by setting the `label-key` property:
|
||||
The Caddy plugin allows you to add custom container labels to apps. These labels are injected into containers during deployment and can be used to configure Caddy behavior beyond what the plugin provides by default.
|
||||
|
||||
Refer to the upstream [caddy-docker-proxy](https://github.com/lucaslorentz/caddy-docker-proxy) documentation for more information on what labels are available.
|
||||
|
||||
#### Adding a label
|
||||
|
||||
To add a custom container label to an app, use the `caddy:labels:add` command:
|
||||
|
||||
```shell
|
||||
dokku caddy:set node-js-app label-key caddy_0
|
||||
dokku caddy:labels:add node-js-app caddy.directive value
|
||||
```
|
||||
|
||||
This will update the app's label key to `caddy_0`. The label key is used to identify the app in the Caddy configuration. If you change the label key, you will need to restart or rebuild the app to apply the updates.
|
||||
This will add the label `caddy.directive=value` to the app's containers. After adding a label, you will need to rebuild or redeploy the app for the label to be applied to running containers.
|
||||
|
||||
```shell
|
||||
dokku ps:rebuild node-js-app
|
||||
```
|
||||
|
||||
#### Removing a label
|
||||
|
||||
To remove a custom container label from an app, use the `caddy:labels:remove` command:
|
||||
|
||||
```shell
|
||||
dokku caddy:labels:remove node-js-app caddy.directive
|
||||
```
|
||||
|
||||
This will remove the specified label from the app. After removing a label, you will need to rebuild or redeploy the app for the change to be applied to running containers.
|
||||
|
||||
```shell
|
||||
dokku ps:rebuild node-js-app
|
||||
```
|
||||
|
||||
#### Showing labels
|
||||
|
||||
To view all custom container labels for an app, use the `caddy:labels:show` command:
|
||||
|
||||
```shell
|
||||
dokku caddy:labels:show node-js-app
|
||||
```
|
||||
|
||||
To view a specific label value, provide the label name:
|
||||
|
||||
```shell
|
||||
dokku caddy:labels:show node-js-app caddy.directive
|
||||
```
|
||||
|
||||
### SSL Configuration
|
||||
|
||||
|
||||
@@ -113,6 +113,54 @@ dokku haproxy:set --global log-level DEBUG
|
||||
|
||||
After modifying, the Haproxy container will need to be restarted.
|
||||
|
||||
### Label Management
|
||||
|
||||
The Haproxy plugin allows you to add custom container labels to apps. These labels are injected into containers during deployment and can be used to configure Haproxy behavior beyond what the plugin provides by default.
|
||||
|
||||
Refer to the upstream [EasyHaproxy](https://github.com/byjg/docker-easy-haproxy) documentation for more information on what labels are available.
|
||||
|
||||
#### Adding a label
|
||||
|
||||
To add a custom container label to an app, use the `haproxy:labels:add` command:
|
||||
|
||||
```shell
|
||||
dokku haproxy:labels:add node-js-app haproxy.directive value
|
||||
```
|
||||
|
||||
This will add the label `haproxy.directive=value` to the app's containers. After adding a label, you will need to rebuild or redeploy the app for the label to be applied to running containers.
|
||||
|
||||
```shell
|
||||
dokku ps:rebuild node-js-app
|
||||
```
|
||||
|
||||
#### Removing a label
|
||||
|
||||
To remove a custom container label from an app, use the `haproxy:labels:remove` command:
|
||||
|
||||
```shell
|
||||
dokku haproxy:labels:remove node-js-app haproxy.directive
|
||||
```
|
||||
|
||||
This will remove the specified label from the app. After removing a label, you will need to rebuild or redeploy the app for the change to be applied to running containers.
|
||||
|
||||
```shell
|
||||
dokku ps:rebuild node-js-app
|
||||
```
|
||||
|
||||
#### Showing labels
|
||||
|
||||
To view all custom container labels for an app, use the `haproxy:labels:show` command:
|
||||
|
||||
```shell
|
||||
dokku haproxy:labels:show node-js-app
|
||||
```
|
||||
|
||||
To view a specific label value, provide the label name:
|
||||
|
||||
```shell
|
||||
dokku haproxy:labels:show node-js-app haproxy.directive
|
||||
```
|
||||
|
||||
### SSL Configuration
|
||||
|
||||
The haproxy plugin only supports automatic ssl certificates from it's letsencrypt integration. Managed certificates provided by the `certs` plugin are ignored.
|
||||
|
||||
@@ -124,6 +124,54 @@ The following folders within an app repository may have `*.conf` files that will
|
||||
- `openresty/http-includes/`: Injected in the `server` block serving http(s) requests for the app.
|
||||
- `openresty/http-location-includes/`: Injected in the `location` block that proxies to the app in the app's respective `server` block.
|
||||
|
||||
### Label Management
|
||||
|
||||
The OpenResty plugin allows you to add custom container labels to apps. These labels are injected into containers during deployment and can be used to configure OpenResty behavior beyond what the plugin provides by default.
|
||||
|
||||
Refer to the upstream [openresty-docker-proxy](https://github.com/dokku/openresty-docker-proxy) documentation for more information on what labels are available.
|
||||
|
||||
#### Adding a label
|
||||
|
||||
To add a custom container label to an app, use the `openresty:labels:add` command:
|
||||
|
||||
```shell
|
||||
dokku openresty:labels:add node-js-app openresty.directive value
|
||||
```
|
||||
|
||||
This will add the label `openresty.directive=value` to the app's containers. After adding a label, you will need to rebuild or redeploy the app for the label to be applied to running containers.
|
||||
|
||||
```shell
|
||||
dokku ps:rebuild node-js-app
|
||||
```
|
||||
|
||||
#### Removing a label
|
||||
|
||||
To remove a custom container label from an app, use the `openresty:labels:remove` command:
|
||||
|
||||
```shell
|
||||
dokku openresty:labels:remove node-js-app openresty.directive
|
||||
```
|
||||
|
||||
This will remove the specified label from the app. After removing a label, you will need to rebuild or redeploy the app for the change to be applied to running containers.
|
||||
|
||||
```shell
|
||||
dokku ps:rebuild node-js-app
|
||||
```
|
||||
|
||||
#### Showing labels
|
||||
|
||||
To view all custom container labels for an app, use the `openresty:labels:show` command:
|
||||
|
||||
```shell
|
||||
dokku openresty:labels:show node-js-app
|
||||
```
|
||||
|
||||
To view a specific label value, provide the label name:
|
||||
|
||||
```shell
|
||||
dokku openresty:labels:show node-js-app openresty.directive
|
||||
```
|
||||
|
||||
### SSL Configuration
|
||||
|
||||
The OpenResty plugin only supports automatic ssl certificates from it's letsencrypt integration. Managed certificates provided by the `certs` plugin are ignored.
|
||||
|
||||
@@ -127,6 +127,54 @@ dokku traefik:set --global log-level DEBUG
|
||||
|
||||
After modifying, the Traefik container will need to be restarted.
|
||||
|
||||
### Label Management
|
||||
|
||||
The Traefik plugin allows you to add custom container labels to apps. These labels are injected into containers during deployment and can be used to configure Traefik behavior beyond what the plugin provides by default.
|
||||
|
||||
Refer to the upstream [Traefik](https://doc.traefik.io/traefik/) documentation for more information on what labels are available.
|
||||
|
||||
#### Adding a label
|
||||
|
||||
To add a custom container label to an app, use the `traefik:labels:add` command:
|
||||
|
||||
```shell
|
||||
dokku traefik:labels:add node-js-app traefik.directive value
|
||||
```
|
||||
|
||||
This will add the label `traefik.directive=value` to the app's containers. After adding a label, you will need to rebuild or redeploy the app for the label to be applied to running containers.
|
||||
|
||||
```shell
|
||||
dokku ps:rebuild node-js-app
|
||||
```
|
||||
|
||||
#### Removing a label
|
||||
|
||||
To remove a custom container label from an app, use the `traefik:labels:remove` command:
|
||||
|
||||
```shell
|
||||
dokku traefik:labels:remove node-js-app traefik.directive
|
||||
```
|
||||
|
||||
This will remove the specified label from the app. After removing a label, you will need to rebuild or redeploy the app for the change to be applied to running containers.
|
||||
|
||||
```shell
|
||||
dokku ps:rebuild node-js-app
|
||||
```
|
||||
|
||||
#### Showing labels
|
||||
|
||||
To view all custom container labels for an app, use the `traefik:labels:show` command:
|
||||
|
||||
```shell
|
||||
dokku traefik:labels:show node-js-app
|
||||
```
|
||||
|
||||
To view a specific label value, provide the label name:
|
||||
|
||||
```shell
|
||||
dokku traefik:labels:show node-js-app traefik.directive
|
||||
```
|
||||
|
||||
### SSL Configuration
|
||||
|
||||
The traefik plugin only supports automatic ssl certificates from it's letsencrypt integration. Managed certificates provided by the `certs` plugin are ignored.
|
||||
|
||||
Reference in New Issue
Block a user