Hello, I have a problem with traefik that I would like to connect to an openlitespeed container, the litespeed container works fine, if I go to localhost:81 I receive the response from openlitespeed, but admin.localhost returns a "Gateway Timeout" from Traefik, I do not understand what I missed, the domain in openlitespeed is registered in localhost, it may have a relationship?
services:
mysql:
image: mariadb:lts
command: ["--max-allowed-packet=512M"]
volumes:
- "./data/db:/var/lib/mysql:delegated"
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
restart: always
networks:
- db
traefik:
image: "traefik:v3.0" # Image Docker à utiliser
container_name: "Traefik"
restart: always
networks:
- traefik-nt
command:
- "--api.dashboard=true" # Active le tableau de bord de l'API Traefik
- "--api.insecure=false" # Désactive l'accès non sécurisé à l'API
- "--providers.docker=true" # Active Docker comme fournisseur
- "--providers.docker.exposedbydefault=false" # N'expose pas les conteneurs par défaut
- "--providers.docker.watch" # Surveille les changements dans Docker
- "--entrypoints.web.address=:80" # Définit le point d'entrée web sur le port 80
- "--providers.docker.network=traefik-nt"
ports:
- 80:80
labels:
- "traefik.enable=true" # Active Traefik pour ce service
- "traefik.http.routers.traefik.rule=Host(`traefik.localhost`)" # Règle pour le routeur Traefik
- "traefik.http.routers.traefik.entrypoints=web" # Point d'entrée pour le routeur Traefik
- "traefik.http.routers.traefik.service=api@internal" # Service pour le routeur Traefik
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
litespeed:
image: litespeedtech/openlitespeed:${OLS_VERSION}-${PHP_VERSION}
container_name: litespeed
env_file:
- .env
volumes:
- ./lsws/conf:/usr/local/lsws/conf
- ./lsws/admin-conf:/usr/local/lsws/admin/conf
- ./bin/container:/usr/local/bin
- ./sites:/var/www/vhosts/
- ./acme:/root/.acme.sh/
- ./logs:/usr/local/lsws/logs/
restart: always
ports:
- 81:80
environment:
TZ: ${TimeZone}
networks:
- db
- traefik-nt
labels:
- "traefik.enable=true"
- "traefik.http.routers.litespeed.rule=Host(`admin.localhost`)"
- "traefik.http.routers.litespeed.entrypoints=web"
- "traefik.http.routers.litespeed.service=litespeed"
- "traefik.http.services.litespeed.loadbalancer.server.port=80"
- "traefik.http.services.litespeed.loadbalancer.server.scheme=http"
- traefik.http.services.wordpress_ahs.loadbalancer.passHostHeader=1
networks:
traefik-nt:
db:
services:
mysql:
image: mariadb:lts
command: ["--max-allowed-packet=512M"]
volumes:
- "./data/db:/var/lib/mysql:delegated"
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
restart: always
networks:
- db
traefik:
image: "traefik:v3.0" # Image Docker à utiliser
container_name: "Traefik"
restart: always
networks:
- traefik-nt
command:
- "--api.dashboard=true" # Active le tableau de bord de l'API Traefik
- "--api.insecure=false" # Désactive l'accès non sécurisé à l'API
- "--providers.docker=true" # Active Docker comme fournisseur
- "--providers.docker.exposedbydefault=false" # N'expose pas les conteneurs par défaut
- "--providers.docker.watch" # Surveille les changements dans Docker
- "--entrypoints.web.address=:80" # Définit le point d'entrée web sur le port 80
- "--providers.docker.network=traefik-nt"
ports:
- 80:80
labels:
- "traefik.enable=true" # Active Traefik pour ce service
- "traefik.http.routers.traefik.rule=Host(`traefik.localhost`)" # Règle pour le routeur Traefik
- "traefik.http.routers.traefik.entrypoints=web" # Point d'entrée pour le routeur Traefik
- "traefik.http.routers.traefik.service=api@internal" # Service pour le routeur Traefik
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
litespeed:
image: litespeedtech/openlitespeed:${OLS_VERSION}-${PHP_VERSION}
container_name: litespeed
env_file:
- .env
volumes:
- ./lsws/conf:/usr/local/lsws/conf
- ./lsws/admin-conf:/usr/local/lsws/admin/conf
- ./bin/container:/usr/local/bin
- ./sites:/var/www/vhosts/
- ./acme:/root/.acme.sh/
- ./logs:/usr/local/lsws/logs/
restart: always
ports:
- 81:80
environment:
TZ: ${TimeZone}
networks:
- db
- traefik-nt
labels:
- "traefik.enable=true"
- "traefik.http.routers.litespeed.rule=Host(`admin.localhost`)"
- "traefik.http.routers.litespeed.entrypoints=web"
- "traefik.http.routers.litespeed.service=litespeed"
- "traefik.http.services.litespeed.loadbalancer.server.port=80"
- "traefik.http.services.litespeed.loadbalancer.server.scheme=http"
- traefik.http.services.wordpress_ahs.loadbalancer.passHostHeader=1
networks:
traefik-nt:
db: