WIP

examplecom-file-provider.yml
http:
  routers:
    examplecom:
      rule: Host(`example.com`)
      entryPoints:
        - http
        - https
      service: examplecom
      priority: 50
      middlewares:
        - httpsredirect
 
  services:
    examplecom:
      loadBalancer:
        servers:
          - url: "http://1.2.3.4:8080"
examplecomblog-file-provider.yml
http:
  routers:
    examplecomblog:
      rule: Host(`example.com`) && PathPrefix(`/blog`)
      entryPoints:
        - http
        - https
      service: examplecomblog
      priority: 100
      middlewares:
        - httpsredirect
 
  services:
    examplecomblog:
      loadBalancer:
        servers:
          - url: "http://1.2.3.4:8081"
docker-compose.yml
networks:
  examplenet:
 
services:
  wordpress:
    image: wordpress
    container_name: wordpress
    restart: always
    user: 1000:1000
    networks:
      - examplenet
    ports:
      - 8081:80
    working_dir: /var/www/html/blog
    environment:
      WORDPRESS_DB_HOST: wordpressdb
      WORDPRESS_DB_USER: wordpressdb
      WORDPRESS_DB_PASSWORD: wordpressdb-password
      WORDPRESS_DB_NAME: wordpressdb
    volumes:
      - ./wordpress:/var/www/html/blog
 
  wordpressdb:
    image: mariadb:latest
    container_name: wordpressdb
    hostname: wordpressdb
    restart: always
    networks:
      - examplenet
    environment:
      MARIADB_DATABASE: wordpressdb
      MARIADB_USER: wordpressdb
      MARIADB_PASSWORD: wordpressdb-password
      MARIADB_ROOT_PASSWORD: wordpressdb-root-password
    volumes:
      - ./db:/var/lib/mysql
wp-config.php
/* Add any custom values between this line and the "stop editing" line. */
define('WP_HOME', 'https://example.com/blog');
define('WP_SITEURL', 'https://example.com/blog');
 
// If we're behind a proxy server and using HTTPS, we need to alert WordPress of that fact
// see also https://wordpress.org/support/article/administration-over-ssl/#using-a-reverse-proxy
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) {
	$_SERVER['HTTPS'] = 'on';
}
// (we include this by default because reverse proxying is extremely common in container environments)
 
if ($configExtra = getenv_docker('WORDPRESS_CONFIG_EXTRA', '')) {
	eval($configExtra);
}
 
/* That's all, stop editing! Happy publishing. */