Good morning there. Despite I'm new to Traefik I'm slowly learning how to use it.
I have a bunch of docker containers (each one defined by a docker-compose.yml file) on a home server reachable by IP address that I'd like to reverse proxy via Traefik V2.
My configuration is the following:
- IP address:
192.168.1.23
- Traefik version:
v2.10.4
- Host:
Armbian (23.8.1) aarch64 on a Hardkernel ODROID-N2Plus
- Docker version:
20.10.5+dfsg1, build 55c4c88
I'm currently having issues with speedtest-tracker container. Below its docker-compose.yml
file
version: '3.3'
services:
speedtest-tracker:
container_name: speedtest-tracker
environment:
- PUID=1000
- PGID=1000
- DB_CONNECTION=mysql
- DB_HOST=db
- DB_PORT=3306
- DB_DATABASE=speedtest_tracker
- DB_USERNAME=XXXXXXXXXX
- DB_PASSWORD=XXXXXXXXXX
- TELEGRAM_BOT_TOKEN=XXXXXXXXXX
volumes:
- ./config:/config
image: 'ghcr.io/alexjustesen/speedtest-tracker:latest'
restart: always
depends_on:
- db
networks:
- web
- internal
labels:
- traefik.enable=true
- traefik.http.routers.speedtest-tracker.rule=Host(`192.168.1.23`) && PathPrefix(`/speedtest-tracker`)
- traefik.http.services.speedtest-tracker.loadbalancer.server.port=80
db:
image: mariadb:10
restart: always
environment:
- MARIADB_DATABASE=speedtest_tracker
- MARIADB_USER=XXXXXXXXXX
- MARIADB_PASSWORD=XXXXXXXXXX
- MARIADB_RANDOM_ROOT_PASSWORD=true
volumes:
- ./var_lib_mysql:/var/lib/mysql
networks:
- internal
labels:
- traefik.enable=false
networks:
web:
external: true
internal:
external: false
This is instead my Traefik configuration:
docker-compose.yml:
version: '3.3'
services:
traefik:
image: traefik:latest
container_name: traefik
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- $PWD/traefik.toml:/traefik.toml
- $PWD/traefik_dynamic.toml:/traefik_dynamic.toml
ports:
- "80:80"
networks:
- web
networks:
web:
external: true
traefik.yml:
[entryPoints]
[entryPoints.web]
address = ":80"
[api]
dashboard = true
[providers.docker]
watch = true
network = "web"
[providers.file]
filename = "traefik_dynamic.toml"
traefik_dynamic.toml:
[http.middlewares.simpleAuth.basicAuth]
users = [
"XXXXXXXXXXXXXXX" # Censored
]
[http.routers.api]
rule = "Host(`192.168.1.23`)"
entrypoints = ["web"]
middlewares = ["simpleAuth"]
service = "api@internal"
I can correctly start traefik container as well as speedtest-tracker but when I visit 192.168.1.23/speedtest-tracker
the application replies with a generic HTTP 404 error.
Is there anything wrong with my configuration files?
Thanks in advance and sorry for the noobness, I'm a slow learner