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.
Servicios Incluidos
wordpress
wordpress:6.7-apache
Variables de Entorno:
mysql
mysql:8.0
Variables de Entorno:
phpmyadmin
phpmyadmin:5.2-apache
Variables de Entorno:
YAML Generado
# 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
Información Rápida
- Servicios
- 3
- Redes
- 2
- Volúmenes
- 2
Cuándo Usar
Esta plantilla es ideal para configurar un entorno de wordpress + mysql Todos los servicios vienen preconfigurados con healthchecks, límites de recursos y valores por defecto sensatos. Personaliza las variables de entorno antes de desplegar en producción.
Consejos
- Cambia todas las contraseñas por defecto antes de desplegar
- Revisa los límites de recursos para tu hardware
- Añade un proxy inverso para HTTPS en producción
- Configura estrategias de respaldo para los volúmenes de datos