DEV Community

Cover image for Python script to automate the installation of several cms in Devilbox

Posted on

Python script to automate the installation of several cms in Devilbox

I won't explain in detail as the repo is simple to use but I will just write the structure of the repo, and you are welcome to try and give your suggestions or contributions.

Installation script
Installation steps

  • clone this repository:
  • create virtualenv: virtualenv venv --python=3.6( or any python3 version)
  • Follow the instruction to install python3 in devilbox written in the wiki
  • Your devilbox directory name should be devilbox

The instruction script has the following directories

  • Applicaitons
  • Config
  • Core

Finally, the script that runs the application



This directory consists of all applications that need to be installed, such as

  • Drupal
  • Magento
  • plugins
  • Prestashop
  • WordPress

Each of the above directories contains a python script that installs the application.


The config directory consists of the following config files


    • Method: grep_container returns both mysql_container && php_container

    • This file contains versions that need to be installed
    • Here in this file you can see, the version you want to install
    • Only set the version of the Application you want to install


The core directory has the following files

  • This file creates the database

Some Extra config

Some installations may complain about the PHP memory unit limit, so we should set to all containers default as unlimited by the following.

  • Goto devilbox/cfg/php-ini-phpversion(eg 4.5)
  • then create a new file, that with ini extension, as devilbox-php.ini, then paste the following code
  • Then you need to restart your container once
  • code is


; Memory
; Note: "memory_limit" should be larger than "post_max_size"
memory_limit            = -1
Enter fullscreen mode Exit fullscreen mode

Changes to script on how to install python3 in devilbox

Copy and paste( actually replace it with) the following script to the former script in devilbox, //

#!/usr/bin/env bash


cd ${root}

apt-get update
apt-get install -y python3
apt-get install -y python3-pip
apt-get install python3-distutils

if [ ! -L ${PYTHON3} ] && [ ! -L ${PIP3}]; then
  ln -s /usr/bin/python3 ${PYTHON3}
  ln -s /usr/bin/pip3 ${PIP3}

Enter fullscreen mode Exit fullscreen mode


During Magento 2.4.2 installation the following fatal error occurred. According to the GitHub link

Then, I create the following workaround:

In your .env file inside the devilbox, search for PHP_MODULES_DISABLE and add psr to the list and save and restart docker.
so, finally, it will be:

The phalcon module is also added because it depends on psr


Top comments (0)