forked from Dolibarr/dolibarr-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
456 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
FROM php:7.0-apache-stretch | ||
|
||
MAINTAINER Garcia MICHEL <[email protected]> | ||
|
||
ENV DOLI_VERSION 10.0.3 | ||
|
||
ENV DOLI_INSTALL_AUTO 1 | ||
|
||
ENV DOLI_DB_HOST mysql | ||
ENV DOLI_DB_USER doli | ||
ENV DOLI_DB_PASSWORD doli_pass | ||
ENV DOLI_DB_NAME dolidb | ||
|
||
ENV DOLI_ADMIN_LOGIN admin | ||
ENV DOLI_ADMIN_PASSWORD admin | ||
ENV DOLI_URL_ROOT 'http://localhost' | ||
ENV DOLI_NOCSRFCHECK 0 | ||
|
||
ENV WWW_USER_ID 33 | ||
ENV WWW_GROUP_ID 33 | ||
|
||
ENV PHP_INI_DATE_TIMEZONE 'UTC' | ||
|
||
RUN apt-get update -q && apt-get upgrade -yq \ | ||
&& apt-get install -yq \ | ||
libpng-dev \ | ||
libjpeg-dev \ | ||
libldap2-dev \ | ||
libxml2-dev \ | ||
mysql-client \ | ||
unzip \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ | ||
&& docker-php-ext-install mysqli pdo pdo_mysql gd soap zip \ | ||
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \ | ||
&& docker-php-ext-install ldap | ||
|
||
# Get Dolibarr | ||
ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip | ||
RUN unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr | ||
RUN cp -r /tmp/dolibarr/dolibarr-${DOLI_VERSION}/htdocs/* /var/www/html/ && ln -s /var/www/html /var/www/htdocs | ||
RUN cp -r /tmp/dolibarr/dolibarr-${DOLI_VERSION}/scripts /var/www/ | ||
RUN rm -rf /tmp/dolibarr | ||
|
||
EXPOSE 80 | ||
|
||
COPY docker-run.sh /usr/local/bin/ | ||
ENTRYPOINT ["docker-run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
FROM php:7.1-apache-stretch | ||
|
||
MAINTAINER Garcia MICHEL <[email protected]> | ||
|
||
ENV DOLI_VERSION 10.0.3 | ||
|
||
ENV DOLI_INSTALL_AUTO 1 | ||
|
||
ENV DOLI_DB_HOST mysql | ||
ENV DOLI_DB_USER doli | ||
ENV DOLI_DB_PASSWORD doli_pass | ||
ENV DOLI_DB_NAME dolidb | ||
|
||
ENV DOLI_ADMIN_LOGIN admin | ||
ENV DOLI_ADMIN_PASSWORD admin | ||
ENV DOLI_URL_ROOT 'http://localhost' | ||
ENV DOLI_NOCSRFCHECK 0 | ||
|
||
ENV WWW_USER_ID 33 | ||
ENV WWW_GROUP_ID 33 | ||
|
||
ENV PHP_INI_DATE_TIMEZONE 'UTC' | ||
|
||
RUN apt-get update -q && apt-get upgrade -yq \ | ||
&& apt-get install -yq \ | ||
libpng-dev \ | ||
libjpeg-dev \ | ||
libldap2-dev \ | ||
libxml2-dev \ | ||
mysql-client \ | ||
unzip \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ | ||
&& docker-php-ext-install mysqli pdo pdo_mysql gd soap zip \ | ||
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \ | ||
&& docker-php-ext-install ldap | ||
|
||
# Get Dolibarr | ||
ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip | ||
RUN unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr | ||
RUN cp -r /tmp/dolibarr/dolibarr-${DOLI_VERSION}/htdocs/* /var/www/html/ && ln -s /var/www/html /var/www/htdocs | ||
RUN cp -r /tmp/dolibarr/dolibarr-${DOLI_VERSION}/scripts /var/www/ | ||
RUN rm -rf /tmp/dolibarr | ||
|
||
EXPOSE 80 | ||
|
||
COPY docker-run.sh /usr/local/bin/ | ||
ENTRYPOINT ["docker-run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
FROM php:5.6-apache-stretch | ||
|
||
MAINTAINER Garcia MICHEL <[email protected]> | ||
|
||
ENV DOLI_VERSION 10.0.3 | ||
|
||
ENV DOLI_INSTALL_AUTO 1 | ||
|
||
ENV DOLI_DB_HOST mysql | ||
ENV DOLI_DB_USER doli | ||
ENV DOLI_DB_PASSWORD doli_pass | ||
ENV DOLI_DB_NAME dolidb | ||
|
||
ENV DOLI_ADMIN_LOGIN admin | ||
ENV DOLI_ADMIN_PASSWORD admin | ||
ENV DOLI_URL_ROOT 'http://localhost' | ||
ENV DOLI_NOCSRFCHECK 0 | ||
|
||
ENV WWW_USER_ID 33 | ||
ENV WWW_GROUP_ID 33 | ||
|
||
ENV PHP_INI_DATE_TIMEZONE 'UTC' | ||
|
||
RUN apt-get update -q && apt-get upgrade -yq \ | ||
&& apt-get install -yq \ | ||
libpng-dev \ | ||
libjpeg-dev \ | ||
libldap2-dev \ | ||
libxml2-dev \ | ||
mysql-client \ | ||
unzip \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ | ||
&& docker-php-ext-install mysqli pdo pdo_mysql gd soap zip \ | ||
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \ | ||
&& docker-php-ext-install ldap | ||
|
||
# Get Dolibarr | ||
ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip | ||
RUN unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr | ||
RUN cp -r /tmp/dolibarr/dolibarr-${DOLI_VERSION}/htdocs/* /var/www/html/ && ln -s /var/www/html /var/www/htdocs | ||
RUN cp -r /tmp/dolibarr/dolibarr-${DOLI_VERSION}/scripts /var/www/ | ||
RUN rm -rf /tmp/dolibarr | ||
|
||
EXPOSE 80 | ||
|
||
COPY docker-run.sh /usr/local/bin/ | ||
ENTRYPOINT ["docker-run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ FROM php:7.0-apache-stretch | |
|
||
MAINTAINER Garcia MICHEL <[email protected]> | ||
|
||
ENV DOLI_VERSION 9.0.0 | ||
ENV DOLI_VERSION 9.0.4 | ||
|
||
ENV DOLI_INSTALL_AUTO 1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#!/bin/bash | ||
|
||
usermod -u $WWW_USER_ID www-data | ||
groupmod -g $WWW_GROUP_ID www-data | ||
|
||
if [ ! -d /var/www/documents ]; then | ||
mkdir /var/www/documents | ||
fi | ||
|
||
chown -R www-data:www-data /var/www | ||
|
||
if [ ! -f /usr/local/etc/php/php.ini ]; then | ||
cat <<EOF > /usr/local/etc/php/php.ini | ||
date.timezone = $PHP_INI_DATE_TIMEZONE | ||
sendmail_path = /usr/sbin/sendmail -t -i | ||
EOF | ||
fi | ||
|
||
if [ ! -f /var/www/html/conf/conf.php ]; then | ||
cat <<EOF > /var/www/html/conf/conf.php | ||
<?php | ||
\$dolibarr_main_url_root='${DOLI_URL_ROOT}'; | ||
\$dolibarr_main_document_root='/var/www/html'; | ||
\$dolibarr_main_url_root_alt='/custom'; | ||
\$dolibarr_main_document_root_alt='/var/www/html/custom'; | ||
\$dolibarr_main_data_root='/var/www/documents'; | ||
\$dolibarr_main_db_host='${DOLI_DB_HOST}'; | ||
\$dolibarr_main_db_port='3306'; | ||
\$dolibarr_main_db_name='${DOLI_DB_NAME}'; | ||
\$dolibarr_main_db_prefix='llx_'; | ||
\$dolibarr_main_db_user='${DOLI_DB_USER}'; | ||
\$dolibarr_main_db_pass='${DOLI_DB_PASSWORD}'; | ||
\$dolibarr_main_db_type='mysqli'; | ||
EOF | ||
|
||
chown www-data:www-data /var/www/html/conf/conf.php | ||
chmod 400 /var/www/html/conf/conf.php | ||
fi | ||
|
||
if [ $DOLI_INSTALL_AUTO -eq 1 ]; then | ||
r=1 | ||
while [ $r -ne 0 ]; do | ||
mysql -u $DOLI_DB_USER --protocol tcp -p${DOLI_DB_PASSWORD} -h $DOLI_DB_HOST -e "status" > /dev/null 2>&1 | ||
r=$? | ||
if [ $r -ne 0 ]; then | ||
echo "Waiting that SQL database is up..." | ||
sleep 2 | ||
fi | ||
done | ||
|
||
mysql -u $DOLI_DB_USER -p${DOLI_DB_PASSWORD} -h $DOLI_DB_HOST $DOLI_DB_NAME -e "SELECT * FROM llx_const" > /dev/null 2>&1 | ||
if [ $? -ne 0 ]; then | ||
|
||
for f in /var/www/html/install/mysql/tables/*.sql; do | ||
if [[ $f != *.key.sql ]]; then | ||
echo "Importing table from `basename $f`..." | ||
sed -i 's/--.*//g;' $f # remove all comment | ||
mysql -u $DOLI_DB_USER -p${DOLI_DB_PASSWORD} -h $DOLI_DB_HOST $DOLI_DB_NAME < $f | ||
fi | ||
done | ||
|
||
for f in /var/www/html/install/mysql/tables/*.key.sql; do | ||
echo "Importing table key from `basename $f`..." | ||
sed -i 's/--.*//g;' $f | ||
mysql -u $DOLI_DB_USER -p${DOLI_DB_PASSWORD} -h $DOLI_DB_HOST $DOLI_DB_NAME < $f > /dev/null 2>&1 | ||
done | ||
|
||
for f in /var/www/html/install/mysql/functions/*.sql; do | ||
echo "Importing `basename $f`..." | ||
sed -i 's/--.*//g;' $f | ||
mysql -u $DOLI_DB_USER -p${DOLI_DB_PASSWORD} -h $DOLI_DB_HOST $DOLI_DB_NAME < $f > /dev/null 2>&1 | ||
done | ||
|
||
for f in /var/www/html/install/mysql/data/*.sql; do | ||
echo "Importing data from `basename $f`..." | ||
sed -i 's/--.*//g;' $f | ||
mysql -u $DOLI_DB_USER -p${DOLI_DB_PASSWORD} -h $DOLI_DB_HOST $DOLI_DB_NAME < $f > /dev/null 2>&1 | ||
done | ||
|
||
echo "Create SuperAdmin account ..." | ||
pass_crypted=`echo -n $DOLI_ADMIN_PASSWORD | md5sum | awk '{print $1}'` | ||
mysql -u $DOLI_DB_USER -p${DOLI_DB_PASSWORD} -h $DOLI_DB_HOST $DOLI_DB_NAME -e "INSERT INTO llx_user (entity, login, pass_crypted, lastname, admin, statut) VALUES (0, '${DOLI_ADMIN_LOGIN}', '${pass_crypted}', 'SuperAdmin', 1, 1);" > /dev/null 2>&1 | ||
|
||
echo "Set some default const ..." | ||
mysql -u $DOLI_DB_USER -p${DOLI_DB_PASSWORD} -h $DOLI_DB_HOST $DOLI_DB_NAME -e "DELETE FROM llx_const WHERE name='MAIN_VERSION_LAST_INSTALL';" > /dev/null 2>&1 | ||
mysql -u $DOLI_DB_USER -p${DOLI_DB_PASSWORD} -h $DOLI_DB_HOST $DOLI_DB_NAME -e "DELETE FROM llx_const WHERE name='MAIN_NOT_INSTALLED';" > /dev/null 2>&1 | ||
mysql -u $DOLI_DB_USER -p${DOLI_DB_PASSWORD} -h $DOLI_DB_HOST $DOLI_DB_NAME -e "DELETE FROM llx_const WHERE name='MAIN_LANG_DEFAULT';" > /dev/null 2>&1 | ||
mysql -u $DOLI_DB_USER -p${DOLI_DB_PASSWORD} -h $DOLI_DB_HOST $DOLI_DB_NAME -e "INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_INSTALL', '${DOLI_VERSION}', 'chaine', 0, 'Dolibarr version when install', 0);" > /dev/null 2>&1 | ||
mysql -u $DOLI_DB_USER -p${DOLI_DB_PASSWORD} -h $DOLI_DB_HOST $DOLI_DB_NAME -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('MAIN_LANG_DEFAULT', 'auto', 'chaine', 0, 'Default language', 1);" > /dev/null 2>&1 | ||
|
||
touch /var/www/documents/install.lock | ||
chown www-data:www-data /var/www/documents/install.lock | ||
chmod 400 /var/www/documents/install.lock | ||
fi | ||
fi | ||
|
||
exec apache2-foreground |
Oops, something went wrong.