Hi,
I have been experimenting with Traefik v2 for a while now trying to get a working version of Wordpress running using docker, nginx and php-fpm. After a lot of head-scratching and reading countless articles online I have decided to go back to basics.
I have created a Traefik docker container and a Wordpress container. I am using Traefik CLI only. The site installed ok and I can access it. It seems to work, however Site Health is reporting the errors shown in the screenshot.
Have I got something wrong in my configuration?
version: '3'
services:
traefik-proxy:
container_name: traefik-proxy
image: traefik:v2.1
command:
- "--entrypoints.web.address=:80"
- "--log.level=DEBUG"
- "--log.filePath=./traefik.log"
- "--log.format=json"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedByDefault=false"
- "--providers.docker.network=traefik"
ports:
- "80:80"
- "8080:8080"
labels:
- "traefik.http.routers.api.rule=Host(`traefik.docker.localhost`)"
- "traefik.http.routers.api.entrypoints=web"
- "traefik.http.routers.api.service=api@internal"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- traefik
networks:
traefik:
external: true
version: "3"
services:
test_db:
image: mariadb:10.5.1
container_name: test_db
volumes:
- ./db_data:/var/lib/mysql:rw
environment:
MYSQL_ROOT_PASSWORD: "password"
MYSQL_DATABASE: "wp_test"
MYSQL_USER: "testadmin"
MYSQL_PASSWORD: "admin"
networks:
- test_network
test_wp:
image: wordpress:5.3.2-php7.4
container_name: test_wp
volumes:
- ./html:/var/www/html:rw
environment:
WORDPRESS_DB_HOST: test_db:3306
WORDPRESS_DB_USER: "testadmin"
WORDPRESS_DB_PASSWORD: "admin"
WORDPRESS_DB_NAME: "wp_test"
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.test_wp-http.entrypoints=web"
- "traefik.http.routers.test_wp-http.rule=Host(`testdomain.com`, `www.testdomain.com`)"
networks:
- traefik
- test_network
depends_on:
- test_db
volumes:
db_data: {}
html: {}
networks:
traefik:
external:
name: traefik
test_network:
internal: true