Add automatic container restart to Traefik example
Also switch to volume as it is more flexible than recursive path and add examples for external name See: https://github.com/kereis/traefik-certs-dumper#automatic-container-restart
Dieser Commit ist enthalten in:
Ursprung
0ee8db9758
Commit
3a059fa17c
1 geänderte Dateien mit 17 neuen und 7 gelöschten Zeilen
|
@ -192,7 +192,7 @@ version: '2.1'
|
||||||
services:
|
services:
|
||||||
nginx-mailcow:
|
nginx-mailcow:
|
||||||
networks:
|
networks:
|
||||||
# add Traefik's network
|
# Add Traefik's network
|
||||||
web:
|
web:
|
||||||
labels:
|
labels:
|
||||||
- traefik.enable=true
|
- traefik.enable=true
|
||||||
|
@ -214,14 +214,16 @@ services:
|
||||||
|
|
||||||
certdumper:
|
certdumper:
|
||||||
image: humenius/traefik-certs-dumper
|
image: humenius/traefik-certs-dumper
|
||||||
container_name: traefik_certdumper
|
command: --restart-containers ${COMPOSE_PROJECT_NAME}-postfix-mailcow-1,${COMPOSE_PROJECT_NAME}-nginx-mailcow-1,${COMPOSE_PROJECT_NAME}-dovecot-mailcow-1
|
||||||
network_mode: none
|
network_mode: none
|
||||||
volumes:
|
volumes:
|
||||||
# mount the folder which contains Traefik's `acme.json' file
|
# Mount the volume which contains Traefik's `acme.json' file
|
||||||
# in this case Traefik is started from its own docker compose in ../traefik
|
# Configure the external name in the volume definition
|
||||||
- ../traefik/data:/traefik:ro
|
- acme:/traefik:ro
|
||||||
# mount mailcow's SSL folder
|
# Mount mailcow's SSL folder
|
||||||
- ./data/assets/ssl/:/output:rw
|
- ./data/assets/ssl/:/output:rw
|
||||||
|
# Mount docker socket to restart containers
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
# only change this, if you're using another domain for mailcow's web frontend compared to the standard config
|
# only change this, if you're using another domain for mailcow's web frontend compared to the standard config
|
||||||
|
@ -230,6 +232,14 @@ services:
|
||||||
networks:
|
networks:
|
||||||
web:
|
web:
|
||||||
external: true
|
external: true
|
||||||
|
# Name of the external network
|
||||||
|
name: traefik_web
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
acme:
|
||||||
|
external: true
|
||||||
|
# Name of the external docker volume which contains Traefik's `acme.json' file
|
||||||
|
name: traefik_acme
|
||||||
```
|
```
|
||||||
|
|
||||||
Start the new containers with `docker compose up -d`.
|
Start the new containers with `docker compose up -d`.
|
||||||
|
@ -332,4 +342,4 @@ If you plan to use a server name that is not `MAILCOW_HOSTNAME` in your reverse
|
||||||
ADDITIONAL_SERVER_NAMES=webmail.domain.tld,other.example.tld
|
ADDITIONAL_SERVER_NAMES=webmail.domain.tld,other.example.tld
|
||||||
```
|
```
|
||||||
|
|
||||||
Run `docker compose up -d` to apply.
|
Run `docker compose up -d` to apply.
|
||||||
|
|
Laden …
In neuem Issue referenzieren