Hi
I am running successfully a Traefik v2.4 Docker container and manage to use it on a Home Assistant installation running on another Docker container in the same host (IP: 10.0.5.11). The files I used for that are the following:
docker-compose.yaml:
version: '3'
services:
traefik:
image: traefik:v2.4.6
container_name: traefik
network_mode: host
environment:
- CF_API_EMAIL=hsmptg@gmail.com
- CF_API_KEY=343...daa # Global API Key
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /root/docker/traefik:/etc/traefik
restart: unless-stopped
homeassistant:
container_name: homeassistant
image: homeassistant/home-assistant:stable
volumes:
- /root/docker/hass:/config
environment:
- TZ=Europe/Lisbon
privileged: true
network_mode: host
labels:
- traefik.enable=true
- traefik.http.routers.homeassistant.rule=Host(`my.domain.com`)
- traefik.http.routers.homeassistant.tls=true
- traefik.http.routers.homeassistant.entrypoints=websecure
- traefik.http.routers.homeassistant.tls.certresolver=le
- traefik.http.services.homeassistant.loadbalancer.server.port=8123
restart: unless-stopped
traefik.yml:
entryPoints:
traefik:
address: :8780
web:
address: :80
http:
redirections:
entryPoint:
to: websecure
scheme: https
websecure:
address: :443
providers:
docker:
endpoint: unix:///var/run/docker.sock
watch: true
exposedByDefault: false
api:
dashboard: true
insecure: true
log:
level: DEBUG
accessLog: {}
certificatesResolvers:
le:
acme:
email: hsmptg@gmail.com
storage: /etc/traefik/acme.json
caServer: "https://acme-v02.api.letsencrypt.org/directory"
dnsChallenge:
provider: cloudflare
delayBeforeCheck: 0
resolvers:
- 1.1.1.1:53
- 8.8.8.8:53
But now I would like to run Home Assistant on a separate VM (because using a Docker container, I can not use the Supervisor features of Home Assistant).
But using this setup I do not know how to setup Traefik in order the access of https://my.domain.com will access 10.0.5.249:8123 (the IP:port of the Home Assistant running on the VM).
I suppose I have to change something in the traefik.yml file, somewhere in the providers section, but I did not found any example that I could follow.
Could you please help me, suggesting what I have to do or at least give me some link that can explain this?
Best Regards
Hélio