Skip to content
Snippets Groups Projects
Verified Commit 471c7bd0 authored by David Beniamine's avatar David Beniamine
Browse files

A few more optimizations

parent 1c2df4e2
Branches
No related tags found
No related merge requests found
......@@ -29,7 +29,9 @@ RUN apt-get update && \
php-json \
php-ldap \
php-mbstring \
php-memcached \
php-mysqli \
php-opcache \
php-pdo-mysql \
php-soap \
php-tokenizer \
......@@ -43,23 +45,18 @@ RUN apt-get update && \
ENV PHP_VER 8.2
COPY dolibarr.conf /etc/apache2/sites-enabled/000-default.conf
COPY dolibarr.ini /etc/php/$PHP_VER/fpm/conf.d/00-dolibarr.ini
COPY dolibarr.ini /etc/php/$PHP_VER/cli/conf.d/00-dolibarr.ini
RUN mkdir -p /var/www/
RUN chown -R 1000:www-data /var/www/
RUN mkdir -p /run/php
RUN a2enconf php$PHP_VER-fpm.conf
RUN a2enmod rewrite
RUN a2enmod proxy
RUN a2enmod proxy_fcgi
RUN a2enconf php$PHP_VER-fpm.conf && a2enmod rewrite && a2enmod proxy && a2enmod proxy_fcgi && a2enmod http2 && a2enmod expires
#RUN a2enmod calendar
# Install composer
COPY install_composer.sh /bin
RUN /bin/install_composer.sh
RUN mv /usr/local/bin/composer.phar /usr/local/bin/composer
RUN /bin/install_composer.sh && mv /usr/local/bin/composer.phar /usr/local/bin/composer
ARG LOCALE=en_US-UTF-8
......
......@@ -7,4 +7,16 @@
ErrorLog ${APACHE_LOG_DIR}/dolibarr_erro..log
CustomLog ${APACHE_LOG_DIR}/dolibarr_access.log combined
ExpiresActive On
ExpiresByType image/x-icon A2592000
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType text/css A2592000
ExpiresByType text/javascript A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType application/javascript A2592000
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript
</VirtualHost>
......@@ -12,7 +12,6 @@ if [ "$ENV" == "prod" ]; then
sed -i '/\(xdebug.*\)/d' /etc/php/$PHP_VER/fpm/conf.d/00-dolibarr.ini
sed -i '/error/d' /etc/php/$PHP_VER/fpm/conf.d/00-dolibarr.ini
apt-get purge -y php-xdebug php$PHP_VER-xdebug
apt-get install -y php-opcache php-memcached
cat <<EOF>>/etc/php/$PHP_VER/fpm/conf.d/00-dolibarr.ini
; Enable Opcache
opcache.enable=1
......@@ -29,8 +28,12 @@ opcache.max_file_size=2M
; Enable opcache for the CLI
opcache.enable_cli=1
EOF
cp /etc/php/$PHP_VER/fpm/conf.d/00-dolibarr.ini /etc/php/$PHP_VER/cli/conf.d/00-dolibarr.ini
else
apt-get purge -y php-opcache php-memcached
sed -i 'd/Expires//' /etc/apache2/sites-enabled/000-default.conf
sed -i 'd/AddOutputFilterByType//' /etc/apache2/sites-enabled/000-default.conf
fi
cp /etc/php/$PHP_VER/fpm/conf.d/00-dolibarr.ini /etc/php/$PHP_VER/cli/conf.d/00-dolibarr.ini
echo "*/5 * * * * www-data /usr/bin/php /var/www/dolibarr/scripts/cron/cron_run_jobs.php $CRON_KEY $CRON_USER > /var/www/dolibarr/documents/cron_run_jobs.php.log" >> /etc/crontab
php-fpm$PHP_VER -D
cron -f &
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment