WordPress Deployment Overview¶
Prerequisites¶
The following configuration parameters are required for the application to function correctly:
| Parameter | Value |
|---|---|
| Domain zone | hostkey.in |
| Internal port | 8080 |
| External port (HTTPS) | 443 |
| Internal path | / |
| External path | / |
FQDN of the final panel on hostkey.in domain¶
Domain name template for application access:
| Parameter | Value |
|---|---|
| Prefix | wp |
| Domain | hostkey.in |
| Full template | wp{Server_ID_from_Invapi}.hostkey.in |
File and Directory Structure¶
Main directories used in the system:
-
/root/wordpress— project working directory and Docker Compose configuration file. -
/data/nginx/— Nginx configuration files. -
/data/nginx/user_conf.d/— custom virtual host configurations. -
/data/wordpress— web application content (WordPress files).
Application Installation Process¶
Deployment is performed by creating the necessary directories, generating Nginx and Docker Compose configuration files, and then starting the container environment using the docker compose up -d command. The application uses official WordPress and MariaDB images.
Docker Containers and Execution¶
The application is deployed as a set of three containers:
mariadb¶
-
Image name:
docker.io/bitnami/mariadb:latest -
Restart policy:
unless-stopped -
Volumes:
mariadb_data:/bitnami/mariadb -
Environment variables:
-
MARIADB_USER=wordpress -
MARIADB_DATABASE=wordpress -
MARIADB_PASSWORD={password} -
MARIADB_ROOT_PASSWORD={password}
-
wordpress¶
-
Image name:
docker.io/wordpress:php8.2-fpm -
Restart policy:
unless-stopped -
Ports:
127.0.0.1:9000:9000 -
Volumes:
/data/wordpress:/var/www/html -
Environment variables:
-
MYSQL_ROOT_PASSWORD={password} -
WORDPRESS_DB_PASSWORD={password} -
WORDPRESS_DB_HOST=mariadb -
WORDPRESS_DB_USER=wordpress -
WORDPRESS_DB_NAME=wordpress
-
nginx¶
-
Image name:
jonasal/nginx-certbot:latest -
Restart policy:
unless-stopped -
Network mode:
host -
Environment variables:
[email protected](parameters from/data/nginx/nginx-certbot.envare also used)
-
Volumes:
-
nginx_secrets:/etc/letsencrypt -
/data/nginx/user_conf.d:/etc/nginx/user_conf.d -
/data/wordpress:/var/www/html
-
Application Update¶
Updates are performed via the command:
(executed in the/root/wordpress directory) Permissions Settings¶
To ensure security and correct service operation, the following permissions are set on directories:
-
/datadirectory and subdirectories: ownerroot, grouproot, access mode0640or0755. -
Configuration files in
/data/nginx/: ownerroot, grouproot, access mode0644. -
/root/wordpressdirectory: ownerroot, grouproot, access mode0644(for files) or0755(for directories).
Configuration Files and Data Location¶
| Data Type | Path |
|---|---|
| Docker Compose configuration | /root/wordpress/compose.yml |
| Nginx configuration (custom) | /data/nginx/user_conf.d/wp{server_id}.hostkey.in.conf |
| Nginx environment variables | /data/nginx/nginx-certbot.env |
| Database data (Volume) | mariadb_data |
| SSL certificates (Volume) | nginx_secrets |
| WordPress files | /data/wordpress |
Available Ports for Connection¶
-
80— HTTP (for redirection and Certbot verification). -
443— HTTPS (primary access port for the website). -
9000— PHP-FPM (available locally on the host via127.0.0.1).
Starting and Stopping the Application¶
Container management is performed from the /root/wordpress directory:
-
Start:
-
Stop: