WordPress + MySQL
A straightforward WordPress stack using the official Apache-based WordPress image backed by MySQL 8.0 for database storage and phpMyAdmin for visual database management. Unlike the production stack that uses MariaDB, Nginx, and Redis, this setup is optimized for simplicity and quick deployment. WordPress is exposed on port 8080, phpMyAdmin on port 8081, and MySQL is internal-only on the backend network. All services include health checks and resource limits, with named volumes ensuring data persistence across restarts. Ideal for development environments, small blogs, and getting started with WordPress quickly.
Servizi Inclusi
wordpress
wordpress:6.7-apache
Variabili d'Ambiente:
mysql
mysql:8.0
Variabili d'Ambiente:
phpmyadmin
phpmyadmin:5.2-apache
Variabili d'Ambiente:
YAML Generato
# Generated by ComposeHub (composehub.dev)
name: wordpress-mysql
services:
wordpress:
image: wordpress:6.7-apache
restart: unless-stopped
ports:
- 8080:80
volumes:
- wordpress_data:/var/www/html
environment:
WORDPRESS_DB_HOST: mysql:3306
WORDPRESS_DB_NAME: ${WORDPRESS_DB_NAME:-wordpress}
WORDPRESS_DB_USER: ${WORDPRESS_DB_USER:-wordpress}
WORDPRESS_DB_PASSWORD: ${WORDPRESS_DB_PASSWORD:-changeme}
WORDPRESS_TABLE_PREFIX: ${WORDPRESS_TABLE_PREFIX:-wp_}
WORDPRESS_DEBUG: ${WORDPRESS_DEBUG:-false}
networks:
- frontend
- backend
depends_on:
mysql:
condition: service_healthy
healthcheck:
test:
- CMD-SHELL
- curl -f http://localhost:80/ || exit 1
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
deploy:
resources:
limits:
cpus: "1.00"
memory: 512M
reservations:
cpus: "0.25"
memory: 128M
labels:
com.composeforge.description: WordPress CMS with Apache web server
mysql:
image: mysql:8.0
restart: unless-stopped
command:
- "--default-authentication-plugin=caching_sha2_password"
- "--innodb-buffer-pool-size=256M"
- "--innodb-log-file-size=64M"
- "--innodb-flush-method=O_DIRECT"
- "--character-set-server=utf8mb4"
- "--collation-server=utf8mb4_unicode_ci"
- "--max-connections=100"
volumes:
- mysql_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-rootchangeme}
MYSQL_DATABASE: ${WORDPRESS_DB_NAME:-wordpress}
MYSQL_USER: ${WORDPRESS_DB_USER:-wordpress}
MYSQL_PASSWORD: ${WORDPRESS_DB_PASSWORD:-changeme}
networks:
- backend
healthcheck:
test:
- CMD
- mysqladmin
- ping
- "-h"
- localhost
- "-u"
- root
- "-p${MYSQL_ROOT_PASSWORD:-rootchangeme}"
interval: 15s
timeout: 5s
retries: 5
start_period: 60s
deploy:
resources:
limits:
cpus: "1.00"
memory: 512M
reservations:
cpus: "0.25"
memory: 256M
labels:
com.composeforge.description: MySQL 8.0 database for WordPress
phpmyadmin:
image: phpmyadmin:5.2-apache
restart: unless-stopped
ports:
- 8081:80
environment:
PMA_HOST: mysql
PMA_PORT: "3306"
PMA_ARBITRARY: ${PMA_ARBITRARY:-0}
UPLOAD_LIMIT: ${PMA_UPLOAD_LIMIT:-64M}
networks:
- frontend
- backend
depends_on:
mysql:
condition: service_healthy
healthcheck:
test:
- CMD-SHELL
- curl -f http://localhost:80/ || exit 1
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
deploy:
resources:
limits:
cpus: "0.50"
memory: 256M
reservations:
cpus: "0.10"
memory: 64M
labels:
com.composeforge.description: phpMyAdmin web-based MySQL administration
networks:
frontend:
driver: bridge
backend:
driver: bridge
volumes:
wordpress_data:
driver: local
mysql_data:
driver: local
Informazioni Rapide
- Servizi
- 3
- Reti
- 2
- Volumi
- 2
Quando Usarlo
Questo template è ideale per configurare un ambiente wordpress + mysql Tutti i servizi sono preconfigurati con healthchecks, limiti di risorse e valori predefiniti sensati. Personalizza le variabili d'ambiente prima di fare il deploy in produzione.
Consigli
- Cambia tutte le password predefinite prima del deploy
- Verifica i limiti di risorse per il tuo hardware
- Aggiungi un reverse proxy per HTTPS in produzione
- Configura strategie di backup per i volumi di dati