Hello everyone!
I am trying to use traefik as a learning experience for Docker. so far I'm really liking it and its really helped me understand a lot of concepts. my project is to use traefik on my raspberry pi to host two websites at the same time. I started with the basic guide in the documentation and was successfully able to add my first container and get it running. after a quick stack overflow post I added the domain to my hosts file and was able to access my website through traefik!
Today I though I would try to tackle adding the second website. I copied the section I had for my first website and edited the parts I had changed from the guide. I also added the second domain to my hosts file exactly like the first one.
But when running docker-compose up the container seemed to have started perfectly fine but I haven't been able to access the website. docker ps shows it as running. but when going to traefik dashboard the route and service seemingly just appear and disappear in a rapid 10-20 second cycle.
Going to the second webpage i either get a "bad gateway" or "404".
I can still access the first website perfectly alright.
here is what i have for my docker-compose.yml
version: "3.3"
services:
reverse-proxy:
image: "traefik:v2.2"
container_name: "traefik"
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
restart: alwaysfurriesyelling:
image: "wolfexe57/furriesyelling:1.1"
# container_name: "FY-website"
labels:
- "traefik.enable=true"
- "traefik.http.routers.furriesyelling.rule=Host(www.furriesyelling.com
)"
- "traefik.http.routers.furriesyelling.entrypoints=web"
restart: alwaystoddmcintire:
image: "wolfexe57/website-html-docker:latest"
# container_name: "TM-website"
labels:
- "traefik.enable=true"
- "traefik.http.routers.toddmcintire.rule=Host(www.toddmcintire.com
)"
- "traefik.http.routers.toddmcintire.entrypoints=web"
restart: always
EDIT: I can see via docker PS that it will restart about a second or two after starting.
I also tried setting the ports for the second website but they seem to remain at 80