yea
This commit is contained in:
15
README.md
15
README.md
@@ -4,11 +4,22 @@
|
|||||||
# Einrichten
|
# Einrichten
|
||||||
```
|
```
|
||||||
echo "MYSQL_ROOT_PASSWORD=$( openssl rand -hex 16 )" > .env
|
echo "MYSQL_ROOT_PASSWORD=$( openssl rand -hex 16 )" > .env
|
||||||
MYSQL_DATABASE=wordpress >> .env
|
echo "MYSQL_DATABASE=wordpress" >> .env
|
||||||
MYSQL_USER=wordpress >> .env
|
echo "MYSQL_USER=wordpress" >> .env
|
||||||
echo "MYSQL_PASSWORD=$( openssl rand -hex 16 )" >> .env
|
echo "MYSQL_PASSWORD=$( openssl rand -hex 16 )" >> .env
|
||||||
|
echo "WP_PORT=8080" >> .env
|
||||||
|
echo "STATIC_PORT=8081" >> .env
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Redis Object Cache
|
||||||
|
|
||||||
|
After first `docker compose up`, install the **Redis Object Cache** plugin in WP Admin:
|
||||||
|
1. Plugins → Add New → search "Redis Object Cache" (by Till Krüss)
|
||||||
|
2. Install & Activate
|
||||||
|
3. Settings → Redis → "Enable Object Cache"
|
||||||
|
|
||||||
|
The `wp-config.php` already has the `WP_REDIS_HOST` and `WP_REDIS_PORT` constants set.
|
||||||
|
|
||||||
## Cron
|
## Cron
|
||||||
|
|
||||||
Backup script in Cron einbinden nicht vergessen
|
Backup script in Cron einbinden nicht vergessen
|
||||||
65
compose.yml
65
compose.yml
@@ -11,24 +11,75 @@ services:
|
|||||||
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
||||||
- MYSQL_USER=${MYSQL_USER}
|
- MYSQL_USER=${MYSQL_USER}
|
||||||
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 5
|
||||||
|
start_period: 30s
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
restart: unless-stopped
|
||||||
|
command: redis-server --maxmemory 128mb --maxmemory-policy allkeys-lru
|
||||||
|
volumes:
|
||||||
|
- redis_data:/data
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 3
|
||||||
|
|
||||||
wordpress:
|
wordpress:
|
||||||
image: wordpress:latest
|
image: wordpress:latest
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
volumes:
|
volumes:
|
||||||
- ./wp:/var/www/html
|
- ./wp:/var/www/html
|
||||||
- ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
|
- ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
|
||||||
|
- ./opcache.ini:/usr/local/etc/php/conf.d/opcache.ini
|
||||||
- ./static:/export
|
- ./static:/export
|
||||||
ports:
|
ports:
|
||||||
- 8080:80
|
- ${WP_PORT:-8080}:80
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- WORDPRESS_DB_HOST=db
|
- WORDPRESS_DB_HOST=db
|
||||||
- WORDPRESS_DB_USER=${MYSQL_USER}
|
- WORDPRESS_DB_USER=${MYSQL_USER}
|
||||||
- WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD}
|
- WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD}
|
||||||
- WORDPRESS_DB_NAME=${MYSQL_DATABASE}
|
- WORDPRESS_DB_NAME=${MYSQL_DATABASE}
|
||||||
|
- WORDPRESS_CONFIG_EXTRA=
|
||||||
|
define('WP_REDIS_HOST', 'redis');
|
||||||
|
define('WP_REDIS_PORT', 6379);
|
||||||
|
define('WP_REDIS_TIMEOUT', 1);
|
||||||
|
define('WP_REDIS_READ_TIMEOUT', 1);
|
||||||
|
define('DISALLOW_FILE_EDIT', true);
|
||||||
|
define('WP_AUTO_UPDATE_CORE', 'minor');
|
||||||
|
define('AUTOMATIC_UPDATER_DISABLED', false);
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
|
||||||
static:
|
static:
|
||||||
image: caddy:latest
|
image: caddy:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ./static:/usr/share/caddy
|
- ./static:/usr/share/caddy
|
||||||
ports:
|
ports:
|
||||||
- 8081:80
|
- ${STATIC_PORT:-8081}:80
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
|
||||||
|
networks:
|
||||||
|
frontend:
|
||||||
|
backend:
|
||||||
|
internal: true
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
redis_data:
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
MYSQL_ROOT_PASSWORD=$( openssl rand -hex 16 )
|
MYSQL_ROOT_PASSWORD=$( openssl rand -hex 16 )
|
||||||
MYSQL_DATABASE=wordpress
|
MYSQL_DATABASE=wordpress
|
||||||
MYSQL_USER=wordpress
|
MYSQL_USER=wordpress
|
||||||
MYSQL_PASSWORD=$( openssl rand -hex 16 )
|
MYSQL_PASSWORD=$( openssl rand -hex 16 )
|
||||||
|
WP_PORT=8080
|
||||||
|
STATIC_PORT=8081
|
||||||
8
opcache.ini
Normal file
8
opcache.ini
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
; OPcache – caches compiled PHP for major speed gains
|
||||||
|
opcache.enable=1
|
||||||
|
opcache.memory_consumption=128
|
||||||
|
opcache.interned_strings_buffer=16
|
||||||
|
opcache.max_accelerated_files=10000
|
||||||
|
opcache.revalidate_freq=60
|
||||||
|
opcache.fast_shutdown=1
|
||||||
|
opcache.enable_cli=0
|
||||||
Reference in New Issue
Block a user