This project sets up a WordPress environment using Docker Compose with LiteSpeed, MariaDB, and additional caching layers for high-load WooCommerce websites.
- LiteSpeed Webserver + LiteSpeed PHP (LSPHP) 7.4/8.1/8.2/8.3 Container
- LiteSpeed Memcached Container
- MariaDB 10.6 Container
- phpMyAdmin Container
Infra size: ~940 MB
docker-compose-wordpress-LITESPEED/
├── app/
│ ├── logs/
│ ├── public_html/
│ │ ├── wp-config.php
│ │ ├── .htaccess
│ │ └── ... (WordPress files)
│ └── backup/
├── dockerfiles/
│ ├── mariadb/
│ │ └── Dockerfile
│ ├── litespeed/
│ │ └── Dockerfile
│ └── lsmcd/
│ └── Dockerfile
├── .env.example
├── docker-compose.yml
├── README.md
├── start.sh
├── backup_files.sh
└── clean.sh
To prepare the infrastructure:
git clone https://github.com/lepkov/docker-compose-wordpress-LITESPEED.git
mv .env.example .env
To start the infrastructure:
docker-compose up -d
To stop the infrastructure:
docker-compose down
Additional scripts:
bash start.sh
: Cleans logs and runsdocker-compose up -d
bash backup_files.sh
: Runscp -r "$WORKDIR/public_html" "$WORKDIR/backup/public_html"
with checkingbash clean.sh
: Runsdocker-compose down
,rm -rf app/logs/* && rm -rf app/logs/.*
,docker system prune --all --force
- Open
localhost:8081
in your browser. - Log in to phpMyAdmin with
root/my_password
. - Upload your exported database.
- Upload the website's root directory into the
/app/public_html
folder. - Update the
wp-config.php
file with the new database credentials and add:define('DB_NAME', 'YOUR_DB_NAME'); define('DB_USER', 'root'); define('DB_PASSWORD', 'my_password'); define('WP_HOME', 'http://localhost'); define('WP_SITEURL', 'http://localhost'); define('FS_METHOD', 'direct');
- Update paths in the
.htaccess
file if necessary. - Open
localhost
in your browser to check your website.
Access the LiteSpeed WebAdmin at localhost:7080
with the credentials admin/my_password
.
To connect to LSMCD:
- Hostname:
litespeed_memcache
- Port:
11211
No special credentials are needed.
All logs are located in the /app/logs
folder.
Search and replace the site name in the database:
sed -i 's/original\.site/localhost/g' exported_db.sql
- Ensure you have Docker and Docker Compose installed on your system.
- The
phpmyadmin
service is intended for development purposes and should be disabled in production. - Review and adjust the resource limits and reservations in the
docker-compose.yml
file based on your server's capacity.
Feel free to submit issues and pull requests to improve this project.
This project is licensed under the MIT License.