Deployment Overview of Joomla on Server¶
Prerequisites and Basic Requirements¶
-
Operating System: Ubuntu (implied by installation tasks)
-
Privileges: Root or sudo access is required to manage Docker and system services.
-
Domain Configuration: The application is configured to use the
hostkey.inzone with a specific prefix. -
Networking: Docker Engine must be installed and running.
-
Ports:
-
Port
8080: Internal Joomla service port. -
Port
443: External HTTPS access. -
Port
3306: Internal MySQL service port (bound to the host).
-
FQDN of the Final Panel¶
The application is accessible via the following Fully Qualified Domain Name (FQDN) format, where SERVER_ID is replaced by the unique server identifier:
joomla
File and Directory Structure¶
The deployment utilizes specific directories for configuration, data storage, and proxy management:
-
Nginx Configuration Directory:
/root/nginx- Contains the Docker Compose file for the proxy stack.
-
Nginx User Configuration:
/data/nginx/user_conf.d- Stores specific site configuration files, such as
joomla<SERVER_ID>.hostkey.in.conf.
- Stores specific site configuration files, such as
-
Nginx Secrets: Mounted from the external volume
nginx_secretslocated at/etc/letsencryptwithin the container. -
Data Volumes:
-
MySQL data is stored in the named Docker volume
mysql_datamapping to/var/lib/mysqlinside the container. -
Joomla data is stored in the named Docker volume
joomla_datamapping to/var/www/htmlinside the container.
-
Application Installation Process¶
The application is deployed using Docker containers. The following images and versions are used:
-
Joomla Image:
joomla:latest -
MySQL Image:
mysql:8.0
The deployment involves running two primary containers:
-
MySQL Container:
-
Name:
joomla_db -
Database:
joomla -
User:
joomla_user -
The container is configured with a
restart_policyofalways.
-
-
Joomla Container:
-
Name:
joomla -
Linked to the MySQL container as
mysql. -
The container is configured with a
restart_policyofalways. -
Port mapping exposes internal port
80to host port8080.
-
Docker Containers and Their Deployment¶
The application stack consists of three Docker services managed via specific configurations.
Database Container:
-
Name:
joomla_db -
Image:
mysql:8.0 -
Environment Variables:
-
MYSQL_ROOT_PASSWORD: Set to the SSH password of the host. -
MYSQL_DATABASE:joomla -
MYSQL_USER:joomla_user -
MYSQL_PASSWORD: Set to the SSH password of the host.
-
-
Volumes:
mysql_datamounted to/var/lib/mysql. -
Ports: Host port
3306mapped to container port3306.
Application Container:
-
Name:
joomla -
Image:
joomla:latest -
Environment Variables:
-
JOOMLA_DB_HOST:joomla_db -
JOOMLA_DB_NAME:joomla -
JOOMLA_DB_USER:joomla_user -
JOOMLA_DB_PASSWORD: Set to the SSH password of the host.
-
-
Volumes:
joomla_datamounted to/var/www/html. -
Ports: Host port
8080mapped to container port80. -
Links: Connected to
joomla_dbwith aliasmysql.
Proxy Container Stack: The Nginx proxy with Certbot support is managed via a Docker Compose file located at /root/nginx/compose.yml.
| Parameter | Value |
|---|---|
| Service Image | jonasal/nginx-certbot:latest |
| Restart Policy | unless-stopped |
| Network Mode | host |
| Email for Certbot | [email protected] |
| Environment File | /data/nginx/nginx-certbot.env |
| Secrets Volume | nginx_secrets mapped to /etc/letsencrypt |
| User Config Volume | /data/nginx/user_conf.d mapped to /etc/nginx/user_conf.d |
Proxy Servers¶
Nginx is deployed as a reverse proxy with automatic SSL certificate management via Certbot.
-
Proxy Target: The proxy forwards traffic to the internal Joomla service at
http://127.0.0.1:8080. -
Configuration File: The site-specific configuration is located at
/data/nginx/user_conf.d/joomla<SERVER_ID>.hostkey.in.conf. -
Routing:
-
Incoming requests to the FQDN on port
443are routed to the Nginx container. -
The Nginx container proxies requests to the Joomla container on port
8080. -
SSL termination is handled by the Nginx container using certificates stored in the
nginx_secretsvolume.
-
Databases¶
-
Connection Method: The Joomla container connects to the database via the internal Docker network using the service name
joomla_db(referenced asmysqlvia container link). -
Storage Location: Database persistence is handled by the named Docker volume
mysql_data, which maps to/var/lib/mysqlwithin thejoomla_dbcontainer. -
Connection Settings:
-
Host:
joomla_db -
Database:
joomla -
User:
joomla_user -
Password: Matches the host's SSH password.
-
Permission Settings¶
-
Nginx Directory:
/root/nginxis owned byroot:rootwith permissions0755. -
Compose File:
/root/nginx/compose.ymlis owned byroot:rootwith permissions0644. -
Container Ownership:
-
The Nginx container volumes are mounted from the host root or data directories.
-
Internal file permissions within the Joomla and MySQL containers are managed by their respective default configurations.
-
Available Ports for Connection¶
| Port | Service | Description |
|---|---|---|
443 | Nginx | Secure HTTPS access to the Joomla application. |
8080 | Joomla | Internal service port (not directly accessible from external networks without proxy). |
3306 | MySQL | Internal database port (bound to the host for container communication). |
Starting, Stopping, and Updating¶
Joomla and MySQL Containers: These containers are managed individually via Docker CLI commands on the host.
-
Start:
docker start joomlaanddocker start joomla_db -
Stop:
docker stop joomlaanddocker stop joomla_db -
Restart:
docker restart joomlaanddocker restart joomla_db -
Update Images:
docker pull joomla:latestanddocker pull mysql:8.0
Proxy Stack (Nginx/Certbot): The proxy stack is managed via Docker Compose in the /root/nginx directory.
-
Start/Update:
docker compose up -d(executed in/root/nginx) -
Stop:
docker compose down(executed in/root/nginx)