Hi, I'm new here and looking for a little help. Before I dive into my issue, please know that I did search high and low for a solution online, using google, chatgpt and anything else at my disposal. So far, I'm coming up empty
I believe what I am trying to accomplish is very easy, but somehow I can't get it to work.
I have a Synology NAS running multiple containers in docker. Simply put, I want to be able to create "easy" URL's to point to each of the services in those containers. For example, let's say I have Glances running on 192.168.1.120:61208, I'd like to be able to enter glances.local or similar and just be routed to the correct IP and port. I'm doing all this inside my network. I have no requirement to expose anything to the internet as I use a VPN. I also don't care about HTTPS, or certificates, as everything is happening behind my firewall.
I've read online that there are basically three ways to do this...
- With Traefik
- With NGINX
- With Caddy
I've tried all three and cannot get any of them to work. I think part of the issue is that Synology blocks ports 80 and 443 for use by the DSM software. It redirects port 80 to port 5000 and 443 to 5001. I've tried different networking modes too, including bridge, host, traefik_internal, etc. Still no dice.
I've included copies of my compose.yaml and traefik.yaml below. If anyone would be kind enough to help me, I would sincerely appreciate it. I am sure I am just missing something very simple.
COMPOSE.YAML
services:
traefik:
image: traefik:v2.9 # Use the latest stable Traefik version
container_name: traefik
command:
- --api.insecure=true
- --providers.docker
- --entrypoints.web.address=:80 # HTTP entry point
ports:
- "80:80" # Expose HTTP port
- "8080:8080" # Expose Traefik dashboard (optional)
volumes:
- /var/run/docker.sock:/var/run/docker.sock # Docker socket for dynamic configuration
- /volume1/docker/traefik/traefik.yaml:/etc/traefik/traefik.yaml:ro # Traefik configuration file
networks:
- internal
labels:
# Traefik dashboard
- "traefik.enable=true"
- "traefik.http.routers.traefik.rule=Host(`traefik.local`)"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.entrypoints=web"
- "traefik.http.services.api.loadbalancer.server.port=8080"
# Define other services you want to proxy
myservice:
image: nicolargo/glances:latest-full # Replace with your service's Docker image
container_name: glances
labels:
- "traefik.enable=true"
- "traefik.http.routers.myservice.rule=Host(`myservice.local`) && PathPrefix(`/`)"
- "traefik.http.services.myservice.loadbalancer.server.port=8080"
networks:
- internal
networks:
internal:
driver: bridge
TRAEFIK.YAML
api:
insecure: true # Enable Traefik dashboard
providers:
docker:
exposedByDefault: true # Enable services explicitly with labels
entryPoints:
web:
address: ":80" # HTTP entry point