85 lines
2.1 KiB
YAML
85 lines
2.1 KiB
YAML
services:
|
|
db:
|
|
image: mariadb:12-noble
|
|
command: '--default-authentication-plugin=mysql_native_password'
|
|
volumes:
|
|
- ./db:/var/lib/mysql
|
|
- ./db_import:/docker-entrypoint-initdb.d
|
|
restart: unless-stopped
|
|
environment:
|
|
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
|
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
|
- MYSQL_USER=${MYSQL_USER}
|
|
- 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:
|
|
image: wordpress:latest
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ./wp:/var/www/html
|
|
- ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
|
|
- ./opcache.ini:/usr/local/etc/php/conf.d/opcache.ini
|
|
- ./static:/export
|
|
ports:
|
|
- ${WP_PORT:-8080}:80
|
|
restart: unless-stopped
|
|
environment:
|
|
- WORDPRESS_DB_HOST=db
|
|
- WORDPRESS_DB_USER=${MYSQL_USER}
|
|
- WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD}
|
|
- 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:
|
|
image: caddy:latest
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ./static:/usr/share/caddy
|
|
ports:
|
|
- ${STATIC_PORT:-8081}:80
|
|
networks:
|
|
- frontend
|
|
|
|
networks:
|
|
frontend:
|
|
backend:
|
|
internal: true
|
|
|
|
volumes:
|
|
redis_data: |