Skip to content

Deployment Overview of WordPress + WooCommerce plugin on Server

Prerequisites and Basic Requirements

The application requires a Debian-based operating system. The following prerequisites must be met for a successful deployment:

  • Privileges: Root or sudo access is required to install packages and manage Docker containers.

  • Packages: The following system utilities are installed: lsb-release, apt-transport-https, vim, htop, and zip.

  • Ports:

  • Port 80 (Internal)

  • Port 443 (External/HTTPS)

FQDN of the final panel on the hostkey.in domain

The application is accessible via a specific subdomain template based on your server ID.

Parameter Value
Prefix wp
Domain hostkey.in
Full template wp{Server_ID_from_Invapi}.hostkey.in

File and Directory Structure

The deployment utilizes specific directories for application data, configuration, and certificates:

  • /data/wordpress: Main WordPress application files and plugins.

  • /root/wordpress: Contains the Docker Compose orchestration file.

  • /data/nginx/user_conf.d/: Stores Nginx virtual host configurations.

  • /data/nginx/nginx-certbot.env: Environment configuration for the proxy service.

Application installation process

The installation follows a multi-step process involving system preparation, plugin deployment, and container orchestration:

  1. System Preparation: The package manager is updated, and necessary dependencies (lsb-release, apt-transport-https, etc.) are installed.

  2. Plugin Deployment:

  3. The WooCommerce plugin (version 8.7.0) is downloaded from the official WordPress repository.

  4. The zip file is extracted to a temporary directory.

  5. The extracted folder is moved into the /data/wordpress/wp-content/plugins/ directory to ensure it is available to the application.

  6. Orchestration Setup:

  7. A Docker Compose configuration is generated in /root/wordpress/compose.yml.

  8. An Nginx configuration file is created in /data/nginx/user_conf.d/ to handle SSL termination and routing.

  9. Container Deployment: The application services are started using docker compose up -d.

Access Rights and Security

  • Directory Permissions:

  • /data/wordpress is owned by user ID 33 (standard for web services) with mode 0755.

  • /root/wordpress is restricted to the root user with mode 0640.

  • Network Security: The WordPress application container listens on 127.0.0.1:9000, ensuring it is not directly accessible from the external network, only via the local proxy.

Databases

The application uses a MariaDB database managed within a Docker container.

Parameter Value
Database Name wordpress
Database User wordpress
Connection Host mariadb (internal Docker network)
Storage Location Managed via Docker volume mariadb_data

Docker Containers and Their Deployment

The application is deployed using a Docker Compose setup consisting of three primary services:

MariaDB

  • Image: bitnami/mariadb:latest

  • Restart Policy: unless-stopped

  • Volumes: mariadb_data:/bitnami/mariadb

  • Environment Variables:

  • MARIADB_USER=wordpress

  • MARIADB_DATABASE=wordpress

  • MARIADB_PASSWORD (set during installation)

  • MARIADB_ROOT_PASSWORD (set during installation)

WordPress

  • Image: 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 (set during installation)

  • WORDPRESS_DB_PASSWORD (set during installation)

  • WORDPRESS_DB_HOST=mariadb

  • WORDPRESS_DB_USER=wordpress

  • WORDPRESS_DB_NAME=wordpress

Nginx Proxy (with Certbot)

  • Image: jonasal/nginx-certbot:latest

  • Restart Policy: unless-stopped

  • Network Mode: host

  • Volumes:

  • nginx_secrets:/etc/letsencrypt

  • /data/nginx/user_conf.d:/etc/nginx/user_conf.d

  • /data/wordpress:/var/www/html

  • Environment Variables:

  • [email protected]

Application Update Instructions

To update the main application, navigate to the deployment directory and pull the latest images:

cd /root/wordpress
docker compose pull && docker compose up -d
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×