Last active
April 7, 2020 09:34
-
-
Save psct/f019980d49e5bd87fb3e47e5295741ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nginx-reverse-proxy und Zertifikatsbeschaffer | |
# in ein Unterverzeichnis "le" legen und dort mit | |
# docker-compose starten; dann stimmen die erwähnten | |
# Präfixe aus c't 4/18, S. 88 | |
# aktualisiert 7.2.19 für Compose v3 | |
# (volumes_from nicht mehr unterstützt) | |
version: '3' | |
# user defined network für funktionierende Namensauflösung | |
networks: | |
ext: | |
# separate Volumes, damit Image-Updateas der Container möglich | |
volumes: | |
certs: | |
vhosts: | |
html: | |
services: | |
# der reverse-proxy | |
nginxproxy: | |
image: jwilder/nginx-proxy | |
container_name: nginxproxy | |
hostname: nginxproxy | |
restart: | |
unless-stopped | |
networks: | |
- ext | |
volumes: | |
- certs:/etc/nginx/certs:ro | |
- vhosts:/etc/nginx/vhost.d | |
- html:/usr/share/nginx/html | |
- /var/run/docker.sock:/tmp/docker.sock:ro | |
ports: | |
- 80:80 | |
- 443:443 | |
labels: | |
- com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy | |
# sein Begleiter für die Zerfitikatsbeschaffung | |
nginxproxy_comp: | |
image: jrcs/letsencrypt-nginx-proxy-companion | |
container_name: nginxproxy_comp | |
hostname: nginxproxy_comp | |
restart: | |
unless-stopped | |
depends_on: | |
- nginxproxy | |
networks: | |
- ext | |
volumes: | |
- certs:/etc/nginx/certs | |
- /var/run/docker.sock:/var/run/docker.sock:ro | |
- vhosts:/etc/nginx/vhost.d | |
- html:/usr/share/nginx/html | |
# übrige Volumes abschauen vom reverse-proxy (nur Compose < 3) | |
# volumes_from: | |
# - nginxproxy | |
# Für Experimentierzertifikate (ohne Limitierung der Menge/Zeit) | |
# Kommentarzeichen entfernen, um diese zu verwenden | |
# environment: | |
# - ACME_CA_URI=https://acme-staging.api.letsencrypt.org/directory | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
für Docker auf Windows Hosts, zuerst in Powershell folgende Umgebungsvariable setzen (ohne # ) - siehe auch docker/for-win#1829
$Env:COMPOSE_CONVERT_WINDOWS_PATHS=1