I am able to access the sites from the serving machine, if I use the port number; for example http://localhost:8080 but if I try from outside my lan with url it won't work. I have a frontend rule for traefik that works, but it don't work for the other containers.
docker-compose.yml:
version: "2"
services:
traefik:
image: traefik:latest
command: --api --docker --logLevel=DEBUG
hostname: mysite.ddns.net
restart: unless-stopped
networks:
- web
- bridge
ports:
- 80:80
- 8080:8080
- 443:443
labels:
- "traefik.docker.network=web"
- "traefik.enable=true"
- "traefik.backend=traefik"
- "traefik.frontend.rule=Host:${DOMAINNAME}; PathPrefixStrip: /traefik"
- "traefik.port=8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- "/docker/traefikcompose/traefik.toml:/etc/traefik/traefik.toml"
- /docker/traefikcompose:/etc/traefik:rw
container_name: traefik
networks:
web:
external: true
bridge:
external: false
traefik.toml:
traefikLogsFile = "log/traefik.log"
accessLogsFile = "log/access.log"
ProvidersThrottleDuration = "5s"
MaxIdleConnsPerHost = 200
debug = true
logLevel = "ERROR"
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[retry]
[api]
#dashboard = true
#entryPoint = "dashboard"
address= ":8080"
[docker]
endpoint = "unix:///var/run/docker.sock"
#endpoint = "//var/run/docker.sock:/var/run/docker.sock"
domain = "mysite.ddns.net"
watch = true
exposedbydefault = true
[acme]
email = "mymail@gmail.com"
#caServer = "https://acme-staging-v02.api.letsencrypt.org/directory"
storage = "acme.json"
entryPoint = "https"
acmeLogging = true
onDemand = true
OnHostRule = true
[acme.httpChallenge]
entryPoint = "http"
[[acme.domains]]
main = "mysite.ddns.net"
I have a Ghost-Blog and Home-assistant in separate ymls:
Ghost Blog Docker-Compose:
version: "2"
services:
ghost:
image: ghost
container_name: ghost
hostname: mysite.ddns.net
restart: unless-stopped
networks:
- web
- bridge
ports:
- 2368:2368
labels:
- "traefik.docker.network=web"
- "traefik.enable=true"
- "traefik.backend=ghost"
- "traefik.frontend.rule=Host:${DOMAINNAME}; PathPrefixStrip: /blog, ${DOMAINNAME}"
- "traefik.port=2368"
volumes:
- "/docker/ghost/blog:/var/lib/ghost/content"
environment:
- NODE_ENV=production
- url=http://mysite.ddns.net
networks:
web:
external: true
bridge:
external: false
Home Assistent Docker Compose:
version: "2"
services:
home-assistant:
image: homeassistant/home-assistant
container_name: home-assistant
hostname: mysite.ddns.net
privileged: true
restart: unless-stopped
networks:
- web
- bridge
ports:
- 8123:8123
- 8943:8943
labels:
- "traefik.docker.network=web"
- "traefik.enable=true"
- "traefik.backend=home-assistant"
- "traefik.frontend.rule=Host:${DOMAINNAME}; PathPrefixStrip: /hass"
- "traefik.port=8123"
#- "traefik.basic.protocol=http"
volumes:
- "/docker/home-assistant/config:/config"
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
devices:
- "/dev/bus/usb:/dev/bus/usb"
networks:
web:
external: true
bridge:
external: false
DOMAINNAME is defined and works in a .env file. I have opened ports 80, 443, 2368, 8123, 8080 in firewall and router.
Any suggestions?