Script which with the help of docker will quickly create a ready dev environment for any version of PrestaShop.
MIT License
Bash script which with the help of docker will quickly create a ready dev environment for any version of PrestaShop.
Bundled with MariaDB, phpMyAdmin, MailHog and IonCube, along with a support for your own entries in php.ini.
Just clone the repository
git clone https://github.com/presta-expert/dev-environment && cd dev-environment
Then just run bundled bash script ./bin/dev.sh specifying the version of PrestaShop which you want to use
bin/dev.sh [up/down/start/stop/pause/build] prestashop_version
bin/dev.sh up 1.7.8.8
NOTE: You may be asked for the sudo password to set permissions, please provide it or run the script with sudo and NEVER use it in production.
After a few moments your PrestaShop is installed and running at http://localhost:8080 (BO: http://localhost:8080/admin-dev), your dev environment also includes:
To check current PrestaShop installation progress run docker logs [your container hash for PrestaShop]
(hash can be found manually using docker ps
command).
Your PrestaShop will be built in the ./builds directory under the name ./builds/prestashop_{SPECIFIED_VERSION} for example ./builds/prestashop_1.7.8.8
Sometimes you may need to adjust some additional environment parameters, you can do it by modifying .env file inside your built PrestaShop (i.e. ./builds/prestashop_1.7.8.8/.env) and rebuilding the environment using i.e. bin/dev.sh up 1.7.8.8
Argument | Description | Default |
---|---|---|
PRESTASHOP_VERSION | PrestaShop version to use | 1.7.8.8 |
MARIADB_VERSION | MariaDB version to use | 10.6 |
PHPMYADMIN_VERSION | phpMyAdmin version to use | 5.2 |
MAILHOG_VERSION | MailHog version to use | 1.0.1 |
DB_SERVER | MariaDB hostname | mysql |
DB_USER | MariaDB username | prestashop |
DB_PASSWD | MariaDB username password | prestashop |
DB_NAME | MariaDB database name | prestashop |
PS_INSTALL_AUTO | PrestaShop auto installation | 1 |
PS_FOLDER_INSTALL | PrestaShop install directory | install-dev |
PS_FOLDER_ADMIN | PrestaShop admin directory | admin-dev |
PS_DOMAIN | PrestaShop domain | localhost:8080 |
PS_COUNTRY | PrestaShop default country | pl |
PS_LANGUAGE | PrestaShop default language | pl |
PS_DEV_MODE | PrestaShop dev mode | 0 |
PS_ADMIN_MAIL | PrestaShop administrator e-mail | [email protected] |
PS_ADMIN_PASSWD | PrestaShop administrator e-mail | presta.expert |
You can use any tag from the official PrestaShop Docker Hub https://hub.docker.com/r/prestashop/prestashop/tags, similarly you can specify custom tag for:
bin/dev.sh up 1.6.1.8
bin/dev.sh up 1.5.6.3
bin/dev.sh up 8.0.0-7.4-apache
You can also change version of the other services by modifying .env file inside your already built PrestaShop (i.e. ./builds/prestashop_1.7.8.8/.env):
# Custom phpmyadmin and mailhog versions
PHPMYADMIN_VERSION=5.1
MAILHOG_VERSION=1.0.0
NOTE: We do not recommend downgrading the MariaDB version due to possible compatibility issues with database files previously created (db-data volume). If you absolutely need a different version of MariaDB set it manually in ./src/.env before building PrestaShop.
Don't forget to rebuild your environment after above change using i.e. bin/dev.sh up 1.7.8.8
Our dev environment also includes support for creating and overwriting entries from php.ini.
To set your own entries just edit the php.ini file in the .docker/config directory inside your built PrestaShop (i.e. ./builds/prestashop_1.7.8.8/.docker/config/php.ini) and rebuild the environment using i.e. bin/dev.sh build 1.7.8.8 && bin/dev.sh up 1.7.8.8
Several entries are already automatically added to each build:
; Come on... we are parsing a lot of data sometimes
max_execution_time = 0
memory_limit = 256M
; Modules or themes can be pretty big sometimes
upload_max_filesize = 128M
post_max_size = 128M
; Translation feature in older versions of PrestaShop can exceed default limit
max_input_vars = 10000
; Make MailHog work by default with PrestaShop
sendmail_path = /usr/local/bin/mhsendmail
The files in this archive are released under the MIT LICENSE.