The following image have been used:
- PHP 7.4.28
- MySQL 5.7
- Redis 6.2.6
- WordPress 5.9.2
- Nginx 1.21.4
Using the startup wizard to install and run the project
git clone https://github.com/kynguyen98/wordpress-LEMP.git
cd wordpress-LEMP
sudo chmod +x ./startup.sh
sudo ./startup.sh
- Docker
You can get the latest Docker Version from the Docker Official Website
For Ubuntu based here For Debian based here For Red Hat/CentOS here
- Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
- Create a network interface
docker network create -d bridge <network_name>
- OpenSSL
openssl req -x509 -nodes -newkey rsa:4096 -days 365 -keyout ./nginx/ssl/web.key -out ./nginx/ssl/web.crt -subj "/C=US/ST=GA/L=Atlanta/O=NHK Inc/OU=DevOps Department/CN=wordpress-test.com"
- dhparam
openssl dhparam -out dhparam.pem 1024
docker-compose up
Testing your container by typing your host IP address with HTTPS
for TLS/SSL connection
To increase the maximum file size to upload on WordPress, change these settings to enable it
- Nginx Configuration nginx.conf
# Can be increase at any size, using M as standard unit (Megabyte)
client_max_body_size 100M
- PHP-FPM Configuration php.init
# Can be increase at any size, using M as standard unit (Megabyte)
post_max_size = 200M
upload_max_filesize = 200M
To allow upload unsupported file, change the compose file under these line
WORDPRESS_CONFIG_EXTRA: |
define('ALLOW_UNFILTERED_UPLOADS', true);
- The
WORDPRESS_CONFIG_EXTRA
in compose file works but will not visible inside the container
To directly control the Docker Engine inside a remote VM or cloud servers without having to resolve with SSH connection. Even tho SSH connection is practically secure with a private key from the client-side and public key on the server-side but the SSH protocol uses port 22 which is a well-known port that many outsiders already knew and may attempt to access and login to the VM. Instead, if the VM is only running docker then the client-side doesn't need to access and control the Docker Engine via SSH connection (the client-side could if they want to). For more information, click here