Here is a docker compose file
version: "3"
networks:
vester-net:
services:
traefik:
image: traefik:v2.10
container_name: traefik
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./apps/traefik/traefik.yaml:/etc/traefik/traefik.yaml:ro # static traefik configuration
- ./apps/traefik/dynamic.yaml:/etc/traefik/dynamic.yaml:ro # dynamic traefik configuration
- ./apps/traefik/acme.json:/etc/traefik/acme.json # TLS certificate storage
networks:
- vester-net
ports:
- "80:80"
- 443:443
labels:
- "traefik.enable=true"
# define traefik dashboard router and service
- "traefik.http.routers.traefik.rule=Host(`${FQDN}`)" # change hostname!
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.tls.certresolver=tlschallenge"
- "traefik.http.routers.traefik.entrypoints=web-secure"
- "traefik.http.routers.traefik.middlewares=secHeaders@file"
- "traefik.http.services.traefik.loadbalancer.server.port=8080"
score:
image: python:3.11.6
container_name: score
environment:
- "PROJECT_NAME=score"
- "GIT_REPOS=score-engine"
- "GIT_BRANCH=master"
env_file:
- ./.env
restart: unless-stopped
volumes:
- ./apps/score/run_root.sh:/run.sh:rw
command: ["/bin/bash", "-c", "./run.sh"]
networks:
- vester-net
ports:
- "8001:8001"
depends_on:
- traefik
labels:
- "traefik.enable=true"
- "traefik.http.routers.score.rule=(Host(`${FQDN}`) && PathPrefix(`/score`))"
- "traefik.http.routers.score.entrypoints=web-secure"
- "traefik.http.routers.score.service=score@docker"
- "traefik.http.services.score.loadbalancer.server.port=8001"
When I go to https://${FQDN}/, everything goes well: it redirects to traefik dashboard and it works.
When I go to https://${FQDN}/score, it says 404 page not found.
I would love to have the community support on this. Thanks in advance.