From aadadb0762b27ee468d87ede748c17d1e562125d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Sep 2024 21:29:48 +0200 Subject: [PATCH] More code comment. Rename /home/dolibarr_data into /home/dolibarr_documents --- CONTRIBUTING.md | 26 ++++++++++++++++++-------- README.md | 8 ++++---- README.template | 8 ++++---- docker-init.php | 7 +++++-- docker-run.sh | 2 +- images/15.0.3-php7.4/docker-init.php | 7 +++++-- images/15.0.3-php7.4/docker-run.sh | 2 +- images/16.0.5-php8.1/docker-init.php | 7 +++++-- images/16.0.5-php8.1/docker-run.sh | 2 +- images/17.0.4-php8.1/docker-init.php | 7 +++++-- images/17.0.4-php8.1/docker-run.sh | 2 +- images/18.0.5-php8.1/docker-init.php | 7 +++++-- images/18.0.5-php8.1/docker-run.sh | 2 +- images/19.0.3-php8.2/docker-init.php | 7 +++++-- images/19.0.3-php8.2/docker-run.sh | 2 +- images/develop/docker-init.php | 7 +++++-- images/develop/docker-run.sh | 2 +- 17 files changed, 68 insertions(+), 37 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 90dbb64..9d65a0e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,17 +1,20 @@ # Contributing -1. Create only head Dolibarr version for each Major release in file `versions.sh`. + +1. List one head Dolibarr version for each Major release in the file `versions.sh`. 2. Keep only one Dockerfile.template file, use `sed` value replacement in `update.sh` 3. Keep most up to date PHP version that matches each [Dolibarr releases](https://wiki.dolibarr.org/index.php/Versions). 4. Be careful about [supported PHP versions](https://www.php.net/supported-versions.php), try to avoid deprecated PHP version, but only if it doesn't break rule #3. -5. Run the `update.sh` script -6. check the `README.md`, to ensure it is well formatted (on some environment `Supported Tags` could be broken) +5. Run the `update.sh` script to generate all the files rquired to build each Docker images. +6. Check the `README.md`, to ensure it is well formatted (on some environment `Supported Tags` could be broken) 7. Commit all content in `images` directory 8. Open a pull request with a polite and well described content ^_^ + # How to create images -All is done through the `update.sh` script, Dolibarr version to build are stored in `versions.sh` + +All is done through the `update.sh` script, Dolibarr versions to build are stored in `versions.sh` Ensure that the var `DOLIBARR_VERSIONS` in `versions.sh` is having all versions you want to build. -Run the script. +Just run the script update.sh. ## Tips You can ask the script to build and push version for you: just add `DOCKER_BUILD=1` and `DOCKER_PUSH=1` in command line. @@ -19,21 +22,28 @@ You can ask the script to build and push version for you: just add `DOCKER_BUILD $> DOCKER_BUILD=1 DOCKER_PUSH=1 ./update.sh ``` + # Test your local copy before PR + For convenience, you can use the `test.sh` script, it will build and run containers based on existing Dockerfile in `images` directory. (You'd better run `update.sh` before) ```bash -$> ./test.sh +$> sudo ./test.sh ``` * DOLIBARR_VERSION : (Mandatory) the version you want to build and run. * PHP_VERSION : (Optional) the Dolibarr version with this PHP version you want to run specifically, if omitted it will use the most up to date PHP version. If you want to run Dolibarr 14.0.3 with PHP 7.4 ```bash -$> ./test.sh 14.0.3 7.4 +$> sudo ./test.sh 14.0.3 7.4 ``` If you want to run Dolibarr 14.0.3 with most up-to-date PHP version ```bash -$> ./test.sh 14.0.3 +$> sudo ./test.sh 14.0.3 +``` + +If you want to run Dolibarr develop with most up-to-date PHP version +```bash +$> sudo ./test.sh develop ``` Here are links for running containers : diff --git a/README.md b/README.md index 80820be..1951444 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,9 @@ using the tools saved in the [Dolibarr docker build repository](https://github.c This image does not contains database, so you need to link it with a database container. Let's use [Docker Compose](https://docs.docker.com/compose/) to integrate it with [MariaDB](https://hub.docker.com/_/mariadb/) (you can also use [MySQL](https://hub.docker.com/_/mysql/) if you prefer): If you want to have a persistent database and dolibarr data files after reboot or upgrade, you must first -create a directory /home/mariadb_data, /home/dolibarr_data and /home/dolibarr_custom on you host to store persistent files, respectively, of the database, of the Dolibarr document fils and of the external Dolibarr modules. +create a directory `/home/mariadb_data`, `/home/dolibarr_documents` and `/home/dolibarr_custom` on your host to store persistent files, respectively, of the database, of the Dolibarr document files and of the installed external Dolibarr modules. -`mkdir /home/mariadb_data /home/dolibarr_data /home/dolibarr_custom;` +`mkdir /home/mariadb_data /home/dolibarr_documents /home/dolibarr_custom;` Then, create a `docker-compose.yml` file as following: @@ -61,13 +61,13 @@ services: DOLI_URL_ROOT: 'http://0.0.0.0' DOLI_ADMIN_LOGIN: 'admin' DOLI_ADMIN_PASSWORD: 'admin' - PHP_INI_DATE_TIMEZONE: 'Europe/Paris' + DOLI_INIT_DEMO: 0 ports: - "80:80" links: - mariadb volumes: - - /home/dolibarr_data:/var/www/documents + - /home/dolibarr_documents:/var/www/documents - /home/dolibarr_custom:/var/www/html/custom ``` diff --git a/README.template b/README.template index dd38ced..f0cd4e9 100644 --- a/README.template +++ b/README.template @@ -29,9 +29,9 @@ using the tools saved in the [Dolibarr docker build repository](https://github.c This image does not contains database, so you need to link it with a database container. Let's use [Docker Compose](https://docs.docker.com/compose/) to integrate it with [MariaDB](https://hub.docker.com/_/mariadb/) (you can also use [MySQL](https://hub.docker.com/_/mysql/) if you prefer): If you want to have a persistent database and dolibarr data files after reboot or upgrade, you must first -create a directory /home/mariadb_data, /home/dolibarr_data and /home/dolibarr_custom on you host to store persistent files, respectively, of the database, of the Dolibarr document fils and of the external Dolibarr modules. +create a directory `/home/mariadb_data`, `/home/dolibarr_documents` and `/home/dolibarr_custom` on your host to store persistent files, respectively, of the database, of the Dolibarr document files and of the installed external Dolibarr modules. -`mkdir /home/mariadb_data /home/dolibarr_data /home/dolibarr_custom;` +`mkdir /home/mariadb_data /home/dolibarr_documents /home/dolibarr_custom;` Then, create a `docker-compose.yml` file as following: @@ -55,13 +55,13 @@ services: DOLI_URL_ROOT: 'http://0.0.0.0' DOLI_ADMIN_LOGIN: 'admin' DOLI_ADMIN_PASSWORD: 'admin' - PHP_INI_DATE_TIMEZONE: 'Europe/Paris' + DOLI_INIT_DEMO: 0 ports: - "80:80" links: - mariadb volumes: - - /home/dolibarr_data:/var/www/documents + - /home/dolibarr_documents:/var/www/documents - /home/dolibarr_custom:/var/www/html/custom ``` diff --git a/docker-init.php b/docker-init.php index 1fe71a3..5006905 100644 --- a/docker-init.php +++ b/docker-init.php @@ -1,5 +1,8 @@ #!/usr/bin/env php