by default disable traefik service for docker container

This commit is contained in:
Pim Kunis 2023-02-07 23:25:30 +01:00
parent c5ad2aab9f
commit 4d8f9e816c
10 changed files with 16 additions and 1 deletions

View file

@ -12,6 +12,7 @@ services:
networks: networks:
- traefik - traefik
labels: labels:
- traefik.enable=true
- traefik.http.routers.blog.entrypoints=websecure - traefik.http.routers.blog.entrypoints=websecure
- traefik.http.routers.blog.rule=Host(`pizzapim.nl`) - traefik.http.routers.blog.rule=Host(`pizzapim.nl`)
- traefik.http.routers.blog.tls=true - traefik.http.routers.blog.tls=true

View file

@ -20,6 +20,7 @@ services:
- /etc/timezone:/etc/timezone:ro - /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
labels: labels:
- traefik.enable=true
- traefik.http.routers.forgejo.entrypoints=websecure - traefik.http.routers.forgejo.entrypoints=websecure
- traefik.http.routers.forgejo.rule=Host(`git.pizzapim.nl`) - traefik.http.routers.forgejo.rule=Host(`git.pizzapim.nl`)
- traefik.http.routers.forgejo.tls=true - traefik.http.routers.forgejo.tls=true

View file

@ -24,11 +24,12 @@ services:
ADMIN_API_PASSWORD: {{ admin_password }} ADMIN_API_PASSWORD: {{ admin_password }}
PUBLISHED_PORT: 443 PUBLISHED_PORT: 443
labels: labels:
- traefik.enable=true
- traefik.http.routers.freshrss.entrypoints=websecure - traefik.http.routers.freshrss.entrypoints=websecure
- traefik.http.routers.freshrss.rule=Host(`rss.pizzapim.nl`) - traefik.http.routers.freshrss.rule=Host(`rss.pizzapim.nl`)
- traefik.http.routers.freshrss.tls=true - traefik.http.routers.freshrss.tls=true
- traefik.http.routers.freshrss.tls.certresolver=pizzapim - traefik.http.routers.freshrss.tls.certresolver=pizzapim
- traefik.tcp.routers.freshrss.service=freshrss - traefik.http.routers.freshrss.service=freshrss
networks: networks:
traefik: traefik:

View file

@ -21,6 +21,7 @@ services:
- meet.jitsi - meet.jitsi
- traefik - traefik
labels: labels:
- traefik.enable=true
- traefik.http.routers.jitsi-web.entrypoints=websecure - traefik.http.routers.jitsi-web.entrypoints=websecure
- traefik.http.routers.jitsi-web.rule=Host(`{{ public_domain }}`) - traefik.http.routers.jitsi-web.rule=Host(`{{ public_domain }}`)
- traefik.http.routers.jitsi-web.tls=true - traefik.http.routers.jitsi-web.tls=true
@ -96,6 +97,7 @@ services:
networks: networks:
meet.jitsi: meet.jitsi:
labels: labels:
- traefik.enable=true
- traefik.udp.routers.jitsi-videobridge.rule=HostSNI(`*`) - traefik.udp.routers.jitsi-videobridge.rule=HostSNI(`*`)
- traefik.udp.routers.jitsi-videobridge.entrypoints=video - traefik.udp.routers.jitsi-videobridge.entrypoints=video
- traefik.udp.routers.jitsi-videobridge.service=jitsi-videobridge - traefik.udp.routers.jitsi-videobridge.service=jitsi-videobridge

View file

@ -49,6 +49,7 @@ services:
- {{ data_dir }}/public/system:/mastodon/public/system - {{ data_dir }}/public/system:/mastodon/public/system
- {{ service_dir }}/cache:/mastodon/public/system/cache - {{ service_dir }}/cache:/mastodon/public/system/cache
labels: labels:
- traefik.enable=true
- traefik.http.routers.mastodon.entrypoints=websecure - traefik.http.routers.mastodon.entrypoints=websecure
- traefik.http.routers.mastodon.rule=Host(`social.pizzapim.nl`) - traefik.http.routers.mastodon.rule=Host(`social.pizzapim.nl`)
- traefik.http.routers.mastodon.tls=true - traefik.http.routers.mastodon.tls=true
@ -73,6 +74,7 @@ services:
- db - db
- redis - redis
labels: labels:
- traefik.enable=true
- traefik.http.routers.mastodon-streaming.entrypoints=websecure - traefik.http.routers.mastodon-streaming.entrypoints=websecure
- "traefik.http.routers.mastodon-streaming.rule=(Host(`social.pizzapim.nl`) && PathPrefix(`/api/v1/streaming`))" - "traefik.http.routers.mastodon-streaming.rule=(Host(`social.pizzapim.nl`) && PathPrefix(`/api/v1/streaming`))"
- traefik.http.routers.mastodon-streaming.service=mastodon-streaming - traefik.http.routers.mastodon-streaming.service=mastodon-streaming

View file

@ -12,6 +12,7 @@ services:
- default - default
- traefik - traefik
labels: labels:
- traefik.enable=true
- traefik.http.routers.miniflux.entrypoints=websecure - traefik.http.routers.miniflux.entrypoints=websecure
- traefik.http.routers.miniflux.rule=Host(`rss.pizzapim.nl`) - traefik.http.routers.miniflux.rule=Host(`rss.pizzapim.nl`)
- traefik.http.routers.miniflux.tls=true - traefik.http.routers.miniflux.tls=true

View file

@ -16,7 +16,9 @@ services:
networks: networks:
- traefik - traefik
labels: labels:
- traefik.enable=true
- traefik.http.routers.radicale.entrypoints=websecure - traefik.http.routers.radicale.entrypoints=websecure
- traefik.http.routers.radicale.rule=Host(`dav.pizzapim.nl`) - traefik.http.routers.radicale.rule=Host(`dav.pizzapim.nl`)
- traefik.http.routers.radicale.tls=true - traefik.http.routers.radicale.tls=true
- traefik.http.routers.radicale.tls.certresolver=pizzapim - traefik.http.routers.radicale.tls.certresolver=pizzapim
- traefik.http.routers.radicale.service=radicale

View file

@ -35,6 +35,7 @@ services:
- SEAFILE_SERVER_LETSENCRYPT=false # Whether to use https or not. - SEAFILE_SERVER_LETSENCRYPT=false # Whether to use https or not.
- SEAFILE_SERVER_HOSTNAME={{ seafile_domain }} # Specifies your host name if https is enabled. - SEAFILE_SERVER_HOSTNAME={{ seafile_domain }} # Specifies your host name if https is enabled.
labels: labels:
- traefik.enable=true
- traefik.http.routers.seafile.entrypoints=websecure - traefik.http.routers.seafile.entrypoints=websecure
- traefik.http.routers.seafile.rule=Host(`files.geokunis2.nl`) - traefik.http.routers.seafile.rule=Host(`files.geokunis2.nl`)
- traefik.http.routers.seafile.tls=true - traefik.http.routers.seafile.tls=true

View file

@ -16,10 +16,12 @@
template: template:
src: "{{ role_path }}/templates/traefik.toml.j2" src: "{{ role_path }}/templates/traefik.toml.j2"
dest: "{{ service_dir }}/traefik.toml" dest: "{{ service_dir }}/traefik.toml"
register: traefik
- name: Copy services.toml - name: Copy services.toml
copy: copy:
src: "{{ role_path }}/files/services.toml" src: "{{ role_path }}/files/services.toml"
dest: "{{ service_dir }}/services.toml" dest: "{{ service_dir }}/services.toml"
register: services
- name: Create traefik network - name: Create traefik network
docker_network: docker_network:
name: "traefik" name: "traefik"
@ -28,3 +30,4 @@
project_src: "{{ service_dir }}" project_src: "{{ service_dir }}"
pull: true pull: true
remove_orphans: true remove_orphans: true
restarted: "{{ traefik.changed or services.changed }}"

View file

@ -26,6 +26,7 @@ loglevel = "DEBUG"
[providers.docker] [providers.docker]
endpoint = "unix:///var/run/docker.sock" endpoint = "unix:///var/run/docker.sock"
exposedByDefault = false
[providers.file] [providers.file]
filename = "/etc/traefik/services.toml" filename = "/etc/traefik/services.toml"