204Joomla - amagerard/Docker GitHub Wiki

Docker/Home

Ubuntu/Casaos.

1-Casaos 2- Portainer 3- Drupal 4- Joomla 5-Wordpress
6-Xwiki 7- Mediawiki 8- Httpd
Docker Zimaos

4. Joomla.

Joomla is a Content Management System.
It is possible to create, manage and easily modify a website.

This procedure is based on this example.

Ubuntu ip : 192.168.60.8/24
Casaos version: v0.4.15
Your username: teacher
Your home directory:/home/teacher

4.1 Create Network and Volumes with Portainer.

Open Portainer for create network and volumes.
http://192.168.60.8:9000

Click on Environments Local.

4.1.1 Each Joomla instance has its container.

  • cnt_jla_wb_number.
  • cnt_jla_db_number.
    Containers will be created from Casaos graphical interface.

4.1.2 Each Joomla instance has its network.

  • net_jla_number.
    Create net_jla_1.
Select Networks.  
Add network.  
Name : net_jla_1  
Add Driver options:  
Name : com.docker.network.bridge.name   value : net_jla_1  
Create the network.  

Name: com.docker.network.bridge.name value : net_jla_1 is not specified, docker will give it a name as br-XXXX.

4.1.3 Each Joomla instance has its volume.

  • vol_jla_wb_number.
  • vol_jla_db_number.
    Create these volumes.
Select Volumes.  
Add volume.  
Name: vol_jla_wb_1  
Create the volume.  
Add the volume.  
Name: vol_jla_db_1  
Create the volume.  

4.2 Install Joomla with a yaml script.

Copy this script in notepad, kate, gedit or another text editor
and save with a name that has a yaml extension.

# 2025, January  
# replace number  by 1 or 2 or ... until 9  
# example n = 1  
# port published wb = 8081  
# port published db = 33771  
# ip = 192.168.60.8  
# your username is teacher  
# you must create network net_jla_1    from portainer before installing joomla.  
# you must create volume vol_jla_wb_1  from portainer before installing joomla.  
# you must create volume vol_jla_db_1  from portainer before installing joomla.  
# you must upload php.ini file  under /DATA/Documents/docker/files  before installing joomla  
#  
# The contents of php.ini are:  
# memory_limit = 500M  
# upload_max_filesize = 500M  
# post_max_size = 500M  
# max_execution_time = 30  
#  
# you can modify  /DATA/Documents/docker/files/php.ini but not delete it.  
#  
# Be careful with the tab, the indentation is 4 characters.  
#  
name: joomla_1  ## change  n of joomla_n  
services:  
    joomla:  
        cpu_shares: 90  
        command: []  
        container_name: cnt_jla_wb_1  ## change  n  of cnt_jla_wb_n  
        depends_on:  
            joomladb:  
                condition: service_started  
                restart: true  
                required: true  
        deploy:  
            resources:  
                limits:  
                    memory: 2048M  
        environment:  
            - JOOMLA_DB_HOST=cnt_jla_db_1  ## change n to cnt_jla_db_n  
            - JOOMLA_DB_PASSWORD=password # change password as you want  
        hostname: cnt_jla_wb_1  ## change n to cnt_jla_wb_n  
        image: joomla:latest  
        links:  
            - joomladb:mariadb  
        ports:  
            - target: 80  
              published: '8081'  ## change  n of 808n  
              protocol: tcp  
        restart: always  
        volumes:  
            - /var/lib/docker/volumes/vol_jla_wb_1/_data:/var/www/html # create volume from   portainer and change  n of vol_jla_wb_n  
            - /DATA/Documents/docker/files/php.ini:/usr/local/etc/php/php.ini # upload  php.ini file  before  on /DATA/Documents/docker/files/  from Casaos GUI  
        devices: []  
        cap_add: []  
        network_mode: net_jla_1 # create network  from portainer and change  n of net_jla_n  
        privileged: false  
    joomladb:  
        cpu_shares: 90  
        command: []  
        container_name: cnt_jla_db_1  ## change  n  of cnt_jla_db_n  
        deploy:  
            resources:  
                limits:  
                   memory: 2048M  
        environment:  
            - MYSQL_ROOT_PASSWORD=password  # it is the same  password JOOMLA_DB_PASSWORD  
        hostname: cnt_jla_db_1 ## change  n of cnt_jla_db_n  
        image: mariadb:latest  
        ports:  
            - target: 3306  
              published: '33771'  ## change  n to  3377n  
              protocol: tcp  
        restart: always  
        volumes:  
            - /var/lib/docker/volumes/vol_jla_db_1/_data:/var/lib/mysql  ## create volume from   portainer and change  n of vol_jla_db_n  
        devices: []  
        cap_add: []  
        network_mode: net_jla_1  # create network  from portainer and change  n of net_jla_1  
        privileged: false  
  
x-casaos:  
    author: self  
    category: self  
    hostname: 192.168.60.8  ## change IP  
    icon: https://docs.joomla.org/images/0/02/Joomla-flat-logo-en.png  # check if existe  
    index: /  
    is_uncontrolled: false  
    port_map: '8081' ## change  n of  808n  
    scheme: http  
    store_app_id: joomla_1  ## change  n of  joomla_n  
    title:  
        custom: joomla_1 ## change  n  of joomla_n  

Certain parameters like Memory Limit, Upload_max_filesize, ... for joomla are defined in php.ini.

You don't need to use ubuntu file explorer or command line.
You can go through the Casaos web GUI.

With a text editor as notepad, gedit or kate , create a file and save with a name php.ini.
Php.ini's content will be.

memory_limit = 500M  
upload_max_filesize = 500M  
post_max_size = 500M  
max_execution_time = 30  

4.2.1 Upload php.ini.

http://192.168.60.8.
Click on File icon.
Then in Documents.
Right Click and choose New folder.
Name: docker
Not shared - Submit.
Then in docker folder.
Right Click and choose New folder.
Name: files.
Not shared - Submit.
Then in files folder.
Right Click and choose Uploads php.ini file.

you can modify php.ini but not delete it.

4.2.2 install Joomla.

Open casaos.
http://192.168.60.8
Click on the "+" which is located in the middle right of the browser web page.
install a customized app.
Click on right top who name "import".
Import.
Click on Drag your Docker Compose here or click to upload.
Search your script yaml .
Submit.
OK and OK.
Install.

Information.
If you want to change your Joomla instance in 2,
edit this file and replace _1 by _2.
Then replace the port 8081 by 8082
and 33771 by 33772.

4.3 Attach volumes with containers.

On portainer, by default the volumes are marked Unused.

Open Portainer.
http://192.168.60.8:9000

Click on Environments Local.

Select Container cnt_jla_wb_1.
Stop cnt_jla_wb_1.
Click on cnt_jla_wb_1.
Click on Duplicate/Edit .
Advanced container settings.
Click on Volumes.
Volumes mapping.
Choose container /var/www/html.
Click on Volume.
Select a Volume.
Choose vol_jla_wb_1 - local.
Click on Deploy the container.
Click on Replace.

Select Container cnt_jla_db_1.
Stop cnt_jla_db_1.
Click on cnt_jla_db_1.
Click on Duplicate/Edit.
Advanced container settings.
Click on Volumes.
Volumes mapping.
Choose container /val/lib/mysql.
Click on Volume.
Select a Volume.
Choose vol_jla_db_1 - local.
Click on Deploy the container.
Click on Replace.

4.4 First access Joomla.

http://192.168.60.8:8081

Select language : English
Setup Site Name : mybeautifulweb
Setup Login Data.
Enter the real name of your Super User: super master
set the username for your Super User account : supermaster
set the password for your Super User account (12 characters): as you want
Enter the email address of the website Super User: as you want
Setup data Base Connection.
Select the data base type: MySQLi
Enter the hostname, usually "localhost" or a name provided by your host: cnt_jla_db_1
Enter the database username you created or a username provided by your host : root
Enter the database password you created or a password provided by your host : password
Enter the database name: cnt_jla_db_1
Install Joomla.
Open administrator.
Login : supermaster
Password: your password

Joomla is ready.

To return to the administrator page.
http://192.168.60.8:8081/administrator