Merge pull request #487 from t3easy/patch-2
Add automatic container restart to Traefik example
Dieser Commit ist enthalten in:
Commit
fbe61cb854
2 geänderte Dateien mit 31 neuen und 12 gelöschten Zeilen
|
@ -212,14 +212,15 @@ services:
|
|||
|
||||
certdumper:
|
||||
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
|
||||
volumes:
|
||||
# mounten Sie den Ordner, der Traefiks `acme.json' Datei enthält
|
||||
# in diesem Fall wird Traefik von seinem eigenen docker compose in ../traefik gestartet
|
||||
- ../traefik/data:/traefik:ro
|
||||
# Binden Sie das Volume, das Traefiks `acme.json' Datei enthält, ein
|
||||
- acme:/traefik:ro
|
||||
# SSL-Ordner von mailcow einhängen
|
||||
- ./data/assets/ssl/:/output:rw
|
||||
# Binden Sie den Docker Socket ein, damit traefik-certs-dumper die Container neu starten kann
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
restart: always
|
||||
environment:
|
||||
# Ă„ndern Sie dies nur, wenn Sie eine andere Domain fĂĽr Mailcows Web-Frontend verwenden als in der Standard-Konfiguration
|
||||
|
@ -228,6 +229,14 @@ services:
|
|||
networks:
|
||||
web:
|
||||
external: true
|
||||
# Name des externen Netzwerks
|
||||
name: traefik_web
|
||||
|
||||
volumes:
|
||||
acme:
|
||||
external: true
|
||||
# Name des externen Docker Volumes, welches Traefiks `acme.json' Datei enthält
|
||||
name: traefik_acme
|
||||
```
|
||||
|
||||
Starten Sie die neuen Container mit `docker compose up -d`.
|
||||
|
@ -330,4 +339,4 @@ Wenn Sie vorhaben, einen Servernamen zu verwenden, der nicht `MAILCOW_HOSTNAME`
|
|||
ADDITIONAL_SERVER_NAMES=webmail.domain.tld,other.example.tld
|
||||
```
|
||||
|
||||
FĂĽhren Sie `docker compose up -d` zum Anwenden aus.
|
||||
FĂĽhren Sie `docker compose up -d` zum Anwenden aus.
|
||||
|
|
|
@ -192,7 +192,7 @@ version: '2.1'
|
|||
services:
|
||||
nginx-mailcow:
|
||||
networks:
|
||||
# add Traefik's network
|
||||
# Add Traefik's network
|
||||
web:
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
|
@ -214,14 +214,16 @@ services:
|
|||
|
||||
certdumper:
|
||||
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
|
||||
volumes:
|
||||
# mount the folder which contains Traefik's `acme.json' file
|
||||
# in this case Traefik is started from its own docker compose in ../traefik
|
||||
- ../traefik/data:/traefik:ro
|
||||
# mount mailcow's SSL folder
|
||||
# Mount the volume which contains Traefik's `acme.json' file
|
||||
# Configure the external name in the volume definition
|
||||
- acme:/traefik:ro
|
||||
# Mount mailcow's SSL folder
|
||||
- ./data/assets/ssl/:/output:rw
|
||||
# Mount docker socket to restart containers
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
restart: always
|
||||
environment:
|
||||
# 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:
|
||||
web:
|
||||
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`.
|
||||
|
@ -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
|
||||
```
|
||||
|
||||
Run `docker compose up -d` to apply.
|
||||
Run `docker compose up -d` to apply.
|
||||
|
|
Laden …
In neuem Issue referenzieren