Serve WordPress under its public HTTPS subdirectory

This commit is contained in:
examples 2026-10-08 21:51:37 +00:00
commit 57996ddf6a

View file

@ -2,6 +2,7 @@ services:
wordpress:
image: wordpress:php8.3-apache
restart: unless-stopped
working_dir: /var/www/html/wordpress
ports:
- "127.0.0.1:${WORDPRESS_PORT:-18404}:80"
environment:
@ -9,10 +10,14 @@ services:
WORDPRESS_DB_NAME: wordpress
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: ${WORDPRESS_DB_PASSWORD:?Set a database password in the Stack secret bindings}
WORDPRESS_PUBLIC_URL: ${WORDPRESS_PUBLIC_URL:?Set the public HTTPS URL ending in /wordpress}
WORDPRESS_CONFIG_EXTRA: |
define('DISALLOW_FILE_EDIT', true);
define('WP_HOME', getenv('WORDPRESS_PUBLIC_URL'));
define('WP_SITEURL', getenv('WORDPRESS_PUBLIC_URL'));
define('FORCE_SSL_ADMIN', true);
volumes:
- wordpress:/var/www/html
- wordpress:/var/www/html/wordpress
depends_on:
db:
condition: service_healthy