- docker-compose.yml: WordPress 6/PHP8.3 + MariaDB 11, port 8080 - setup.sh: WP-CLI install, headless config, 5 categories, 10 sample articles - php.ini: upload/memory limits for media-heavy news content - .env.example: credential placeholders (values in vault) - README.md: quick-start and REST API reference Tested on CT 222 (news-project-test, 10.10.50.140): - REST API /wp-json/wp/v2/ → 200 OK - 5 categories: Football, Basketball, F1, Tennis, MMA - 11 posts confirmed via REST API Co-Authored-By: Paperclip <[email protected]> Made-with: Cursor
52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
services:
|
|
db:
|
|
image: mariadb:11
|
|
restart: unless-stopped
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
|
MYSQL_DATABASE: wordpress
|
|
MYSQL_USER: wordpress
|
|
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
|
|
volumes:
|
|
- db_data:/var/lib/mysql
|
|
healthcheck:
|
|
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
wordpress:
|
|
image: wordpress:6-php8.3-apache
|
|
restart: unless-stopped
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
ports:
|
|
- "8080:80"
|
|
environment:
|
|
WORDPRESS_DB_HOST: db:3306
|
|
WORDPRESS_DB_NAME: wordpress
|
|
WORDPRESS_DB_USER: wordpress
|
|
WORDPRESS_DB_PASSWORD: ${MYSQL_PASSWORD}
|
|
WORDPRESS_TABLE_PREFIX: wp_
|
|
# Disable WordPress cron (use system cron instead)
|
|
WORDPRESS_CONFIG_EXTRA: |
|
|
define('DISABLE_WP_CRON', true);
|
|
define('WP_DEBUG', false);
|
|
define('SCRIPT_DEBUG', false);
|
|
/* REST API — allow all origins for bridge access */
|
|
define('REST_API_ENABLED', true);
|
|
volumes:
|
|
- wp_content:/var/www/html/wp-content
|
|
- ./php.ini:/usr/local/etc/php/conf.d/custom.ini:ro
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost/wp-json/wp/v2/", "-o", "/dev/null", "-w", "%{http_code}"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 60s
|
|
|
|
volumes:
|
|
db_data:
|
|
wp_content:
|