diff --git a/custom.ini b/custom.ini new file mode 100644 index 0000000000000000000000000000000000000000..7e3a09e1263568e7eb7c992a344fa2a2760ac23b --- /dev/null +++ b/custom.ini @@ -0,0 +1,2 @@ +upload_max_filesize = 20M +post_max_size = 40M diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..133ef8bbe2f0d46a267b5eb39c73805d7f90ec4c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,43 @@ +version: '2.3' +networks: + lb_web: + external: true + back: + driver: bridge + ipam: + driver: default + config: + - subnet: 10.0.${SUBNET}.0/24 +services: + db: + image: mariadb:${MARIADB_VERSION:-10.6} + volumes: + - ./db/mysql/runtime:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD + - MYSQL_DATABASE=dolibarr + networks: + - back + app: + image: libresh/dolibarr:${DOLI_VERSION} + links: + - db + volumes: + - ./data/dolibarr-docs:/var/www/documents + - ./custom.ini:/usr/local/etc/php/conf.d/custom.ini + + environment: + - DOLI_DB_HOST=db + - DOLI_DB_USER=root + - DOLI_DB_PASSWORD + - DOLI_DB_NAME=dolibarr + - DOLI_ADMIN_LOGIN + - DOLI_ADMIN_PASSWORD + - DOLI_URL_ROOT=https://${URL} + - PHP_INI_DATE_TIMEZONE='Europe/Paris' + - VIRTUAL_HOST + networks: + - back + - lb_web +volumes: + doli-html: diff --git a/scripts/install b/scripts/install new file mode 100755 index 0000000000000000000000000000000000000000..01168861a33cff918b8cb76509177394a92b6606 --- /dev/null +++ b/scripts/install @@ -0,0 +1,30 @@ +#!/bin/bash -eux + +source /etc/environment + + +DOLI_VERSION=15.0.3 +MYSQL_ROOT_PASSWORD=`tr -dc A-Za-z0-9_ < /dev/urandom | head -c 20 | xargs` + +var=$(for folder in `ls /data/domains`; do cat /data/domains/$folder/.env | grep SUBNET | cut -d"=" -f2; done | sort | tail -n1) +SUBNET=$(($var +1)) +DOLI_ADMIN_LOGIN=admin +DOLI_ADMIN_PASSWORD=`tr -dc A-Za-z0-9_ < /dev/urandom | head -c 20 | xargs` + +echo "URL=${URL}" >> .env + +echo "MARIADB_VERSION=10.6" >> .env +echo "MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}" >> .env +echo "DOLI_DB_PASSWORD=${MYSQL_ROOT_PASSWORD}" >> .env + +echo "MAIL_PASS=${MAIL_PASS}" >> .env +echo "MAIL_USER=${MAIL_USER}" >> .env +echo "MAIL_HOST=${MAIL_HOST}" >> .env +echo "MAIL_PORT=${MAIL_PORT}" >> .env +echo "MAIL_SECURITY=${MAIL_SECURITY}" >> .env + +echo "SUBNET=${SUBNET}" >> .env + +echo "DOLI_ADMIN_LOGIN=${DOLI_ADMIN_LOGIN}" >> .env +echo "DOLI_ADMIN_PASSWORD=${DOLI_ADMIN_PASSWORD}" >> .env +echo "DOLI_VERSION=${DOLI_VERSION}" >> .env