Deployment Overview of Drupal on Server¶
Prerequisites and Basic Requirements¶
To ensure a successful deployment, the following requirements must be met:
-
Operating System: Ubuntu (recommended).
-
Privileges: Root or sudo access is required for package installation and Docker management.
-
Network Ports:
-
443/TCP: External HTTPS traffic. -
8080/TCP: Internal application traffic. -
3306/TCP: Database communication (internal network).
FQDN of the final panel on the hostkey.in domain¶
The application is accessible via a specific subdomain template based on the server ID.
| Parameter | Value |
|---|---|
| Prefix | drupal |
| Domain | hostkey.in |
| Full template | drupal{Server_ID_from_Invapi}.hostkey.in |
Application installation process¶
The application is deployed using a combination of system package management and Docker containers:
-
System Preparation: The server undergoes an automated setup to install the Docker engine and necessary dependencies.
-
Network Configuration: A dedicated Docker network named
drupal-netis created to facilitate secure communication between the application and the database. -
Container Orchestration:
-
The MariaDB database container is initialized with a predefined database name (
drupal) and root credentials. -
The Drupal application container is deployed, configured to communicate with the MariaDB container via the internal network.
-
SSL/Proxy Setup: An Nginx instance with Certbot integration is configured in
/root/nginxto handle SSL termination and provide secure access via HTTPS.
Docker Containers and Their Deployment¶
The deployment utilizes two primary application containers running within a dedicated network.
Database Container¶
-
Image Name:
mariadb:latest -
Container Name:
drupal_db -
Environment Variables:
-
MYSQL_ROOT_PASSWORD: System-generated password. -
MYSQL_DATABASE:drupal -
MYSQL_USER:root -
MYSQL_PASSWORD: System-generated password. -
Restart Policy:
always -
Network:
drupal-net
Application Container¶
-
Image Name:
drupal:latest -
Container Name:
drupal -
Ports:
8080:80(Internal port 80 mapped to host port 8080) -
Environment Variables:
-
DRUPAL_DB_HOST:drupal_db -
DRUPAL_DB_NAME:drupal -
DRUPAL_DB_USER:root -
DRUPAL_DB_PASSWORD: System-generated password. -
DRUPAL_DB_PORT:3306 -
Restart Policy:
always -
Network:
drupal-net
Proxy Container¶
-
Image Name:
jonasal/nginx-certbot:latest -
Container Name: Nginx (managed via compose)
-
Network Mode:
host -
Volumes:
-
nginx_secrets:/etc/letsencrypt -
/data/nginx/user_conf.d:/etc/nginx/user_conf.d -
Restart Policy:
unless-stopped
Application Update Instructions¶
To update the Drupal application, perform the following steps to pull the latest images and restart the services:
Note: It is recommended to back up your database before performing updates.
Location of configuration files and data¶
-
Nginx Configuration:
/data/nginx/user_conf.d -
SSL Certificates: Managed via the
nginx_secretsDocker volume. -
Docker Compose (Proxy):
/root/nginx/compose.yml
Available ports for connection¶
| Port | Service | Access Type |
|---|---|---|
443 | HTTPS (via Nginx Proxy) | External |
8080 | Drupal Web Interface | Internal/Local |
Starting and Stopping the application¶
The containers are configured with restart policies to ensure they start automatically upon system reboot. To manually manage the services, use the following commands:
To stop the proxy service:
To start the proxy service: