cache update
This commit is contained in:
@@ -18,9 +18,14 @@ wp-content/plugins/akismet/
|
||||
wp-content/plugins/fluentform/
|
||||
wp-content/plugins/fluent-crm/
|
||||
wp-content/plugins/fluent-smtp/
|
||||
wp-content/plugins/redis-cache/
|
||||
wp-content/plugins/query-monitor/
|
||||
wp-content/plugins/hello.php
|
||||
wp-content/plugins/index.php
|
||||
|
||||
# Redis object cache drop-in (auto-installed by wpcli service)
|
||||
wp-content/object-cache.php
|
||||
|
||||
# Keep only project plugins/themes
|
||||
!wp-content/plugins/gustavoo-portfolio-core/
|
||||
!wp-content/themes/gustavoo-portfolio/
|
||||
|
||||
@@ -33,7 +33,43 @@ services:
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
|
||||
wpcli:
|
||||
image: wordpress:cli-php8.3
|
||||
user: "33:33"
|
||||
depends_on:
|
||||
wordpress:
|
||||
condition: service_started
|
||||
redis:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
WORDPRESS_DB_HOST: db
|
||||
WORDPRESS_DB_NAME: ${WORDPRESS_DB_NAME}
|
||||
WORDPRESS_DB_USER: ${WORDPRESS_DB_USER}
|
||||
WORDPRESS_DB_PASSWORD: ${WORDPRESS_DB_PASSWORD}
|
||||
HOME: /tmp
|
||||
volumes:
|
||||
- wordpress_data:/var/www/html
|
||||
- ./wp-content/themes:/var/www/html/wp-content/themes
|
||||
- ./wp-content/plugins:/var/www/html/wp-content/plugins
|
||||
- ./docker/wp-init.sh:/wp-init.sh:ro
|
||||
entrypoint: ["sh", "/wp-init.sh"]
|
||||
restart: "no"
|
||||
|
||||
volumes:
|
||||
db_data:
|
||||
wordpress_data:
|
||||
redis_data:
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "[wpcli] Waiting for WordPress core install..."
|
||||
until wp core is-installed --path=/var/www/html 2>/dev/null; do
|
||||
sleep 3
|
||||
done
|
||||
|
||||
if ! wp language core is-installed pt_BR --path=/var/www/html 2>/dev/null; then
|
||||
echo "[wpcli] Installing pt_BR language pack..."
|
||||
wp language core install pt_BR --path=/var/www/html
|
||||
fi
|
||||
|
||||
echo "[wpcli] Activating pt_BR site language..."
|
||||
wp language core activate pt_BR --path=/var/www/html
|
||||
|
||||
echo "[wpcli] Setting Redis connection constants..."
|
||||
wp config set WP_REDIS_HOST redis --type=constant --path=/var/www/html
|
||||
wp config set WP_REDIS_PORT 6379 --type=constant --raw --path=/var/www/html
|
||||
|
||||
if ! wp plugin is-installed redis-cache --path=/var/www/html; then
|
||||
echo "[wpcli] Installing Redis Object Cache plugin..."
|
||||
wp plugin install redis-cache --path=/var/www/html
|
||||
fi
|
||||
|
||||
echo "[wpcli] Activating Redis Object Cache plugin..."
|
||||
wp plugin activate redis-cache --path=/var/www/html
|
||||
|
||||
echo "[wpcli] Enabling Redis object cache..."
|
||||
wp redis enable --path=/var/www/html || wp redis update-dropin --path=/var/www/html
|
||||
|
||||
echo "[wpcli] Redis setup complete."
|
||||
|
||||
if ! wp plugin is-installed query-monitor --path=/var/www/html; then
|
||||
echo "[wpcli] Installing Query Monitor plugin..."
|
||||
wp plugin install query-monitor --path=/var/www/html
|
||||
fi
|
||||
|
||||
echo "[wpcli] Activating Query Monitor plugin..."
|
||||
wp plugin activate query-monitor --path=/var/www/html
|
||||
Reference in New Issue
Block a user