Skip to content

Commit

Permalink
Merge branch 'tuxgasy:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
freechelmi authored Nov 6, 2023
2 parents 8579552 + 1341c6c commit b5161d6
Show file tree
Hide file tree
Showing 31 changed files with 313 additions and 1,075 deletions.
11 changes: 11 additions & 0 deletions Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LABEL maintainer="Garcia MICHEL <[email protected]>"

ENV DOLI_VERSION %DOLI_VERSION%
ENV DOLI_INSTALL_AUTO 1
ENV DOLI_PROD 1

ENV DOLI_DB_TYPE mysqli
ENV DOLI_DB_HOST mysql
Expand Down Expand Up @@ -34,6 +35,15 @@ ENV WWW_GROUP_ID 33

ENV PHP_INI_DATE_TIMEZONE 'UTC'
ENV PHP_INI_MEMORY_LIMIT 256M
ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M
ENV PHP_INI_POST_MAX_SIZE 8M
ENV PHP_INI_ALLOW_URL_FOPEN 0

RUN sed -i \
-e 's/^\(ServerSignature On\)$/#\1/g' \
-e 's/^#\(ServerSignature Off\)$/\1/g' \
-e 's/^\(ServerTokens\) OS$/\1 Prod/g' \
/etc/apache2/conf-available/security.conf

RUN apt-get update -y \
&& apt-get dist-upgrade -y \
Expand Down Expand Up @@ -77,6 +87,7 @@ EXPOSE 80
VOLUME /var/www/documents
VOLUME /var/www/html/custom

COPY docker-init.php /var/www/scripts/
COPY docker-run.sh /usr/local/bin/
ENTRYPOINT ["docker-run.sh"]

Expand Down
88 changes: 47 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ Docker image for Dolibarr with auto installer on first boot.

## Supported tags

* 11.0.5-php7.4 11.0.5 11
* 12.0.5-php7.4 12.0.5 12
* 13.0.4-php7.4 13.0.4 13
* 14.0.5-php7.4 14.0.5 14
* 15.0.3-php7.4 15.0.3 15
* 16.0.4-php8.1 16.0.4 16
* 17.0.0-php8.1 17.0.0 17 latest
* 16.0.5-php8.1 16.0.5 16
* 17.0.3-php8.1 17.0.3 17
* 18.0.2-php8.1 18.0.2 18 latest
* develop

**End of support for PHP < 7.4**

**Dolibarr versions 7, 8, 9, 10 no more updated**
**Dolibarr versions 7, 8, 9, 10, 11, 12, 13, 14 no more updated**

## Supported architectures

Expand Down Expand Up @@ -92,40 +89,49 @@ When setup this way, to upgrade version the use of the web interface is mandator

## Environment variables summary

| Variable | Default value | Description |
| ----------------------------- | ------------------------------ | ----------- |
| **DOLI_INSTALL_AUTO** | *1* | 1: The installation will be executed on first boot
| **DOLI_DB_TYPE** | *mysqli* | Type of the DB server (**mysqli**, pgsql)
| **DOLI_DB_HOST** | *mysql* | Host name of the MariaDB/MySQL server
| **DOLI_DB_HOST_PORT** | *3306* | Host port of the MariaDB/MySQL server
| **DOLI_DB_USER** | *doli* | Database user
| **DOLI_DB_PASSWORD** | *doli_pass* | Database user's password
| **DOLI_DB_NAME** | *dolidb* | Database name
| **DOLI_ADMIN_LOGIN** | *admin* | Admin's login create on the first boot
| **DOLI_ADMIN_PASSWORD** | *admin* | Admin'password
| **DOLI_URL_ROOT** | *http://localhost* | Url root of the Dolibarr installation
| **PHP_INI_DATE_TIMEZONE** | *UTC* | Default timezone on PHP
| **PHP_INI_MEMORY_LIMIT** | *256M* | PHP Memory limit
| **WWW_USER_ID** | | ID of user www-data. ID will not changed if leave empty. During a development, it is very practical to put the same ID as the host user.
| **WWW_GROUP_ID** | | ID of group www-data. ID will not changed if leave empty.
| **DOLI_AUTH** | *dolibarr* | Which method is used to connect users, change to `ldap` or `ldap, dolibarr` to use LDAP
| **DOLI_LDAP_HOST** | *127.0.0.1* | The host of the LDAP server
| **DOLI_LDAP_PORT** | *389* | The port of the LDAP server
| **DOLI_LDAP_VERSION** | *3* | The version of LDAP to use
| **DOLI_LDAP_SERVER_TYPE** | *openldap* | The type of LDAP server (openLDAP, Active Directory, eGroupWare)
| **DOLI_LDAP_LOGIN_ATTRIBUTE** | *uid* | The attribute used to bind users
| **DOLI_LDAP_DN** | *ou=users,dc=my-domain,dc=com* | The base where to look for users
| **DOLI_LDAP_FILTER** | | The filter to authorise users to connect
| **DOLI_LDAP_BIND_DN** | | The complete DN of the user with read access on users
| **DOLI_LDAP_BIND_PASS** | | The password of the bind user
| **DOLI_LDAP_DEBUG** | *false* | Activate debug mode
| **DOLI_CRON** | *0* | 1: Enable cron service
| **DOLI_CRON_KEY** | | Security key launch cron jobs
| **DOLI_CRON_USER** | | Dolibarr user used for cron jobs
| Variable | Default value | Description |
| ------------------------------- | ------------------------------ | ----------- |
| **DOLI_INSTALL_AUTO** | *1* | 1: The installation will be executed on first boot
| **DOLI_PROD** | *1* | 1: Dolibarr will be run in production mode
| **DOLI_DB_TYPE** | *mysqli* | Type of the DB server (**mysqli**, pgsql)
| **DOLI_DB_HOST** | *mysql* | Host name of the MariaDB/MySQL server
| **DOLI_DB_HOST_PORT** | *3306* | Host port of the MariaDB/MySQL server
| **DOLI_DB_USER** | *doli* | Database user
| **DOLI_DB_PASSWORD** | *doli_pass* | Database user's password
| **DOLI_DB_NAME** | *dolidb* | Database name
| **DOLI_ADMIN_LOGIN** | *admin* | Admin's login create on the first boot
| **DOLI_ADMIN_PASSWORD** | *admin* | Admin'password
| **DOLI_URL_ROOT** | *http://localhost* | Url root of the Dolibarr installation
| **PHP_INI_DATE_TIMEZONE** | *UTC* | Default timezone on PHP
| **PHP_INI_MEMORY_LIMIT** | *256M* | PHP Memory limit
| **PHP_INI_UPLOAD_MAX_FILESIZE** | *2M* | PHP Maximum allowed size for uploaded files
| **PHP_INI_POST_MAX_SIZE** | *8M* | PHP Maximum size of POST data that PHP will accept.
| **PHP_INI_ALLOW_URL_FOPEN** | *0* | Allow URL-aware fopen wrappers
| **WWW_USER_ID** | | ID of user www-data. ID will not changed if leave empty. During a development, it is very practical to put the same ID as the host user.
| **WWW_GROUP_ID** | | ID of group www-data. ID will not changed if leave empty.
| **DOLI_AUTH** | *dolibarr* | Which method is used to connect users, change to `ldap` or `ldap, dolibarr` to use LDAP
| **DOLI_LDAP_HOST** | *127.0.0.1* | The host of the LDAP server
| **DOLI_LDAP_PORT** | *389* | The port of the LDAP server
| **DOLI_LDAP_VERSION** | *3* | The version of LDAP to use
| **DOLI_LDAP_SERVER_TYPE** | *openldap* | The type of LDAP server (openLDAP, Active Directory, eGroupWare)
| **DOLI_LDAP_LOGIN_ATTRIBUTE** | *uid* | The attribute used to bind users
| **DOLI_LDAP_DN** | *ou=users,dc=my-domain,dc=com* | The base where to look for users
| **DOLI_LDAP_FILTER** | | The filter to authorise users to connect
| **DOLI_LDAP_BIND_DN** | | The complete DN of the user with read access on users
| **DOLI_LDAP_BIND_PASS** | | The password of the bind user
| **DOLI_LDAP_DEBUG** | *false* | Activate debug mode
| **DOLI_CRON** | *0* | 1: Enable cron service
| **DOLI_CRON_KEY** | | Security key launch cron jobs
| **DOLI_CRON_USER** | | Dolibarr user used for cron jobs
| **DOLI_INSTANCE_UNIQUE_ID** | | Secret ID used as a salt / key for some encryption. By default, it is set randomly when the docker container is created.

Some environment variables are compatible with docker secrets behaviour, just add the `_FILE` suffix to var name and point the value file to read.
Environment variables that are compatible with docker secrets:
- `DOLI_DB_USER` => `DOLI_DB_USER_FILE`
- `DOLI_DB_PASSWORD` => `DOLI_DB_PASSWORD_FILE`
- `DOLI_ADMIN_LOGIN` => `DOLI_ADMIN_LOGIN_FILE`
- `DOLI_ADMIN_PASSWORD` => `DOLI_ADMIN_PASSWORD_FILE`

* `DOLI_DB_USER` => `DOLI_DB_USER_FILE`
* `DOLI_DB_PASSWORD` => `DOLI_DB_PASSWORD_FILE`
* `DOLI_ADMIN_LOGIN` => `DOLI_ADMIN_LOGIN_FILE`
* `DOLI_ADMIN_PASSWORD` => `DOLI_ADMIN_PASSWORD_FILE`
* `DOLI_CRON_KEY` => `DOLI_CRON_KEY_FILE`
* `DOLI_CRON_USER` => `DOLI_CRON_USER_FILE`
* `DOLI_INSTANCE_UNIQUE_ID` => `DOLI_INSTANCE_UNIQUE_ID_FILE`
79 changes: 44 additions & 35 deletions README.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Docker image for Dolibarr with auto installer on first boot.

**End of support for PHP < 7.4**

**Dolibarr versions 7, 8, 9, 10 no more updated**
**Dolibarr versions 7, 8, 9, 10, 11, 12, 13, 14 no more updated**

## Supported architectures

Expand Down Expand Up @@ -84,40 +84,49 @@ When setup this way, to upgrade version the use of the web interface is mandator

## Environment variables summary

| Variable | Default value | Description |
| ----------------------------- | ------------------------------ | ----------- |
| **DOLI_INSTALL_AUTO** | *1* | 1: The installation will be executed on first boot
| **DOLI_DB_TYPE** | *mysqli* | Type of the DB server (**mysqli**, pgsql)
| **DOLI_DB_HOST** | *mysql* | Host name of the MariaDB/MySQL server
| **DOLI_DB_HOST_PORT** | *3306* | Host port of the MariaDB/MySQL server
| **DOLI_DB_USER** | *doli* | Database user
| **DOLI_DB_PASSWORD** | *doli_pass* | Database user's password
| **DOLI_DB_NAME** | *dolidb* | Database name
| **DOLI_ADMIN_LOGIN** | *admin* | Admin's login create on the first boot
| **DOLI_ADMIN_PASSWORD** | *admin* | Admin'password
| **DOLI_URL_ROOT** | *http://localhost* | Url root of the Dolibarr installation
| **PHP_INI_DATE_TIMEZONE** | *UTC* | Default timezone on PHP
| **PHP_INI_MEMORY_LIMIT** | *256M* | PHP Memory limit
| **WWW_USER_ID** | | ID of user www-data. ID will not changed if leave empty. During a development, it is very practical to put the same ID as the host user.
| **WWW_GROUP_ID** | | ID of group www-data. ID will not changed if leave empty.
| **DOLI_AUTH** | *dolibarr* | Which method is used to connect users, change to `ldap` or `ldap, dolibarr` to use LDAP
| **DOLI_LDAP_HOST** | *127.0.0.1* | The host of the LDAP server
| **DOLI_LDAP_PORT** | *389* | The port of the LDAP server
| **DOLI_LDAP_VERSION** | *3* | The version of LDAP to use
| **DOLI_LDAP_SERVER_TYPE** | *openldap* | The type of LDAP server (openLDAP, Active Directory, eGroupWare)
| **DOLI_LDAP_LOGIN_ATTRIBUTE** | *uid* | The attribute used to bind users
| **DOLI_LDAP_DN** | *ou=users,dc=my-domain,dc=com* | The base where to look for users
| **DOLI_LDAP_FILTER** | | The filter to authorise users to connect
| **DOLI_LDAP_BIND_DN** | | The complete DN of the user with read access on users
| **DOLI_LDAP_BIND_PASS** | | The password of the bind user
| **DOLI_LDAP_DEBUG** | *false* | Activate debug mode
| **DOLI_CRON** | *0* | 1: Enable cron service
| **DOLI_CRON_KEY** | | Security key launch cron jobs
| **DOLI_CRON_USER** | | Dolibarr user used for cron jobs
| Variable | Default value | Description |
| ------------------------------- | ------------------------------ | ----------- |
| **DOLI_INSTALL_AUTO** | *1* | 1: The installation will be executed on first boot
| **DOLI_PROD** | *1* | 1: Dolibarr will be run in production mode
| **DOLI_DB_TYPE** | *mysqli* | Type of the DB server (**mysqli**, pgsql)
| **DOLI_DB_HOST** | *mysql* | Host name of the MariaDB/MySQL server
| **DOLI_DB_HOST_PORT** | *3306* | Host port of the MariaDB/MySQL server
| **DOLI_DB_USER** | *doli* | Database user
| **DOLI_DB_PASSWORD** | *doli_pass* | Database user's password
| **DOLI_DB_NAME** | *dolidb* | Database name
| **DOLI_ADMIN_LOGIN** | *admin* | Admin's login create on the first boot
| **DOLI_ADMIN_PASSWORD** | *admin* | Admin'password
| **DOLI_URL_ROOT** | *http://localhost* | Url root of the Dolibarr installation
| **PHP_INI_DATE_TIMEZONE** | *UTC* | Default timezone on PHP
| **PHP_INI_MEMORY_LIMIT** | *256M* | PHP Memory limit
| **PHP_INI_UPLOAD_MAX_FILESIZE** | *2M* | PHP Maximum allowed size for uploaded files
| **PHP_INI_POST_MAX_SIZE** | *8M* | PHP Maximum size of POST data that PHP will accept.
| **PHP_INI_ALLOW_URL_FOPEN** | *0* | Allow URL-aware fopen wrappers
| **WWW_USER_ID** | | ID of user www-data. ID will not changed if leave empty. During a development, it is very practical to put the same ID as the host user.
| **WWW_GROUP_ID** | | ID of group www-data. ID will not changed if leave empty.
| **DOLI_AUTH** | *dolibarr* | Which method is used to connect users, change to `ldap` or `ldap, dolibarr` to use LDAP
| **DOLI_LDAP_HOST** | *127.0.0.1* | The host of the LDAP server
| **DOLI_LDAP_PORT** | *389* | The port of the LDAP server
| **DOLI_LDAP_VERSION** | *3* | The version of LDAP to use
| **DOLI_LDAP_SERVER_TYPE** | *openldap* | The type of LDAP server (openLDAP, Active Directory, eGroupWare)
| **DOLI_LDAP_LOGIN_ATTRIBUTE** | *uid* | The attribute used to bind users
| **DOLI_LDAP_DN** | *ou=users,dc=my-domain,dc=com* | The base where to look for users
| **DOLI_LDAP_FILTER** | | The filter to authorise users to connect
| **DOLI_LDAP_BIND_DN** | | The complete DN of the user with read access on users
| **DOLI_LDAP_BIND_PASS** | | The password of the bind user
| **DOLI_LDAP_DEBUG** | *false* | Activate debug mode
| **DOLI_CRON** | *0* | 1: Enable cron service
| **DOLI_CRON_KEY** | | Security key launch cron jobs
| **DOLI_CRON_USER** | | Dolibarr user used for cron jobs
| **DOLI_INSTANCE_UNIQUE_ID** | | Secret ID used as a salt / key for some encryption. By default, it is set randomly when the docker container is created.

Some environment variables are compatible with docker secrets behaviour, just add the `_FILE` suffix to var name and point the value file to read.
Environment variables that are compatible with docker secrets:
- `DOLI_DB_USER` => `DOLI_DB_USER_FILE`
- `DOLI_DB_PASSWORD` => `DOLI_DB_PASSWORD_FILE`
- `DOLI_ADMIN_LOGIN` => `DOLI_ADMIN_LOGIN_FILE`
- `DOLI_ADMIN_PASSWORD` => `DOLI_ADMIN_PASSWORD_FILE`

* `DOLI_DB_USER` => `DOLI_DB_USER_FILE`
* `DOLI_DB_PASSWORD` => `DOLI_DB_PASSWORD_FILE`
* `DOLI_ADMIN_LOGIN` => `DOLI_ADMIN_LOGIN_FILE`
* `DOLI_ADMIN_PASSWORD` => `DOLI_ADMIN_PASSWORD_FILE`
* `DOLI_CRON_KEY` => `DOLI_CRON_KEY_FILE`
* `DOLI_CRON_USER` => `DOLI_CRON_USER_FILE`
* `DOLI_INSTANCE_UNIQUE_ID` => `DOLI_INSTANCE_UNIQUE_ID_FILE`
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ services:
DOLI_CRON: 1
DOLI_CRON_KEY: xxxx
DOLI_CRON_USER: administrator
DOLI_INSTANCE_UNIQUE_ID: xxxx
DOLI_DB_USER_FILE: /run/secrets/mysql-user
DOLI_DB_PASSWORD_FILE: /run/secrets/mysql-password
DOLI_ADMIN_LOGIN: administrator
Expand All @@ -71,6 +72,7 @@ services:
depends_on:
- mariadb
environment:
DOLI_INSTANCE_UNIQUE_ID: xxxx
DOLI_DB_USER_FILE: "/run/secrets/mysql-user"
DOLI_DB_PASSWORD_FILE: "/run/secrets/mysql-password"
DOLI_ADMIN_LOGIN: "administrator"
Expand Down
6 changes: 6 additions & 0 deletions docker-init.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env php
<?php
require_once '../htdocs/master.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/modules/modUser.class.php';
$mod = new modUser($db);
$mod->init();
Loading

0 comments on commit b5161d6

Please sign in to comment.