Add docker-compose example
This commit is contained in:
parent
ceee81afb5
commit
b08c110c83
52
readme.md
52
readme.md
@ -66,6 +66,58 @@ docker run ldez/traefik-certs-dumper:<tag_name>
|
|||||||
|
|
||||||
**Note:** to dump data from Traefik v2, the CLI flag `--version v2` must be added.
|
**Note:** to dump data from Traefik v2, the CLI flag `--version v2` must be added.
|
||||||
|
|
||||||
|
### `docker-compose`
|
||||||
|
|
||||||
|
`docker-compose.yml`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
traefik:
|
||||||
|
image: traefik:1.7
|
||||||
|
command:
|
||||||
|
--entryPoints='Name:http Address::80'
|
||||||
|
--entryPoints='Name:https Address::443 TLS'
|
||||||
|
--defaultentrypoints=http,https
|
||||||
|
--logLevel=DEBUG
|
||||||
|
--docker
|
||||||
|
--docker.exposedByDefault=false
|
||||||
|
--acme
|
||||||
|
--acme.acmeLogging=true
|
||||||
|
--acme.entrypoint=https
|
||||||
|
--acme.storage=/data/acme.json
|
||||||
|
--acme.onHostRule=true
|
||||||
|
--acme.httpChallenge.entryPoint=http
|
||||||
|
ports:
|
||||||
|
- 8001:80
|
||||||
|
- 8002:443
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
- .:/data
|
||||||
|
|
||||||
|
traefik-certs-dumper:
|
||||||
|
image: ldez/traefik-certs-dumper:v2.7.0
|
||||||
|
entrypoint: sh -c '
|
||||||
|
apk add jq
|
||||||
|
; while ! [ -e /data/acme.json ]
|
||||||
|
|| ! [ `jq ".Certificates | length" /data/acme.json` != 0 ]; do
|
||||||
|
sleep 1
|
||||||
|
; done
|
||||||
|
&& traefik-certs-dumper file --watch
|
||||||
|
--source /data/acme.json --dest /data/certs'
|
||||||
|
volumes:
|
||||||
|
- .:/data
|
||||||
|
|
||||||
|
whoami:
|
||||||
|
image: containous/whoami
|
||||||
|
labels:
|
||||||
|
traefik.enable: true
|
||||||
|
traefik.frontend.rule: Host:example.com
|
||||||
|
```
|
||||||
|
|
||||||
|
`traefik` ports are published to `8001` and `8002`. It's assumed here that you need certificates as separate files because you want to put `traefik` behind another proxy.
|
||||||
|
|
||||||
### Simple Dump
|
### Simple Dump
|
||||||
|
|
||||||
```console
|
```console
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user