mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Misc Optimizations: Changes on Dockerfile*
- Moved lenghty docker-php-ext-install before adding contents of FIREFLY_PATH to reduce build time after minor changes in FIREFLY_PATH
This commit is contained in:
parent
f84655e339
commit
ff23898c83
40
Dockerfile
40
Dockerfile
@ -1,12 +1,11 @@
|
|||||||
FROM php:7.2-apache
|
FROM php:7.2-apache
|
||||||
|
|
||||||
ENV FIREFLY_PATH=/var/www/firefly-iii COMPOSER_ALLOW_SUPERUSER=1
|
ENV FIREFLY_PATH=/var/www/firefly-iii COMPOSER_ALLOW_SUPERUSER=1
|
||||||
LABEL version="1.4" maintainer="thegrumpydictator@gmail.com"
|
LABEL version="1.4" maintainer="thegrumpydictator@gmail.com"
|
||||||
|
|
||||||
# Create volumes
|
# Create volumes
|
||||||
VOLUME $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload
|
VOLUME $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload
|
||||||
|
|
||||||
# Install some stuff
|
# Install stuffs Firefly run & depends on: php extensions, locales, dev headers and composer
|
||||||
RUN apt-get update && apt-get install -y libpng-dev \
|
RUN apt-get update && apt-get install -y libpng-dev \
|
||||||
libicu-dev \
|
libicu-dev \
|
||||||
unzip \
|
unzip \
|
||||||
@ -18,10 +17,29 @@ RUN apt-get update && apt-get install -y libpng-dev \
|
|||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ && \
|
||||||
|
docker-php-ext-install -j$(nproc) zip bcmath ldap gd pdo_pgsql pdo_mysql intl opcache && \
|
||||||
|
pecl install memcached-3.1.3 && \
|
||||||
|
docker-php-ext-enable memcached && \
|
||||||
|
a2enmod rewrite && a2enmod ssl && \
|
||||||
|
echo "de_DE.UTF-8 UTF-8\nen_US.UTF-8 UTF-8\nes_ES.UTF-8 UTF-8\nfr_FR.UTF-8 UTF-8\nid_ID.UTF-8 UTF-8\nit_IT.UTF-8 UTF-8\nnl_NL.UTF-8 UTF-8\npl_PL.UTF-8 UTF-8\npt_BR.UTF-8 UTF-8\nru_RU.UTF-8 UTF-8\ntr_TR.UTF-8 UTF-8\nzh_TW.UTF-8 UTF-8\nzh_CN.UTF-8 UTF-8\n\n" > /etc/locale.gen && \
|
||||||
|
locale-gen && \
|
||||||
|
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
|
|
||||||
|
# configure PHP
|
||||||
|
RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini && \
|
||||||
|
sed -i 's/max_execution_time = 30/max_execution_time = 600/' /usr/local/etc/php/php.ini && \
|
||||||
|
sed -i 's/memory_limit = 128M/memory_limit = 512M/' /usr/local/etc/php/php.ini
|
||||||
|
|
||||||
# Copy in Firefly III source
|
# Copy in Firefly III source
|
||||||
WORKDIR $FIREFLY_PATH
|
WORKDIR $FIREFLY_PATH
|
||||||
ADD . $FIREFLY_PATH
|
ADD . $FIREFLY_PATH
|
||||||
|
|
||||||
|
# Ensure correct app directory permission, then `composer install`
|
||||||
|
RUN chown -R www-data:www-data /var/www && \
|
||||||
|
chmod -R 775 $FIREFLY_PATH/storage && \
|
||||||
|
composer install --prefer-dist --no-dev --no-scripts --no-suggest
|
||||||
|
|
||||||
# copy ca certs to correct location
|
# copy ca certs to correct location
|
||||||
COPY ./.deploy/docker/cacert.pem /usr/local/ssl/cert.pem
|
COPY ./.deploy/docker/cacert.pem /usr/local/ssl/cert.pem
|
||||||
|
|
||||||
@ -31,24 +49,6 @@ COPY ./.deploy/docker/apache2.conf /etc/apache2/apache2.conf
|
|||||||
# Enable default site (Firefly III)
|
# Enable default site (Firefly III)
|
||||||
COPY ./.deploy/docker/apache-firefly.conf /etc/apache2/sites-available/000-default.conf
|
COPY ./.deploy/docker/apache-firefly.conf /etc/apache2/sites-available/000-default.conf
|
||||||
|
|
||||||
# Run a lot of installation commands:
|
|
||||||
RUN chown -R www-data:www-data /var/www && \
|
|
||||||
chmod -R 775 $FIREFLY_PATH/storage && \
|
|
||||||
a2enmod rewrite && a2enmod ssl && \
|
|
||||||
docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ && \
|
|
||||||
docker-php-ext-install -j$(nproc) zip bcmath ldap gd pdo_pgsql pdo_mysql intl opcache && \
|
|
||||||
pecl install memcached-3.1.3 && \
|
|
||||||
docker-php-ext-enable memcached && \
|
|
||||||
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
|
|
||||||
echo "de_DE.UTF-8 UTF-8\nen_US.UTF-8 UTF-8\nes_ES.UTF-8 UTF-8\nfr_FR.UTF-8 UTF-8\nid_ID.UTF-8 UTF-8\nit_IT.UTF-8 UTF-8\nnl_NL.UTF-8 UTF-8\npl_PL.UTF-8 UTF-8\npt_BR.UTF-8 UTF-8\nru_RU.UTF-8 UTF-8\ntr_TR.UTF-8 UTF-8\nzh_TW.UTF-8 UTF-8\nzh_CN.UTF-8 UTF-8\n\n" > /etc/locale.gen && \
|
|
||||||
locale-gen && \
|
|
||||||
composer install --prefer-dist --no-dev --no-scripts --no-suggest
|
|
||||||
|
|
||||||
# configure PHP
|
|
||||||
RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini && \
|
|
||||||
sed -i 's/max_execution_time = 30/max_execution_time = 600/' /usr/local/etc/php/php.ini && \
|
|
||||||
sed -i 's/memory_limit = 128M/memory_limit = 512M/' /usr/local/etc/php/php.ini
|
|
||||||
|
|
||||||
# Expose port 80
|
# Expose port 80
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ LABEL version="1.4" maintainer="thegrumpydictator@gmail.com"
|
|||||||
# Create volumes
|
# Create volumes
|
||||||
VOLUME $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload
|
VOLUME $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload
|
||||||
|
|
||||||
# Install some stuff
|
# Install stuffs Firefly run & depends on: php extensions, locales, dev headers and composer
|
||||||
RUN apt-get update && apt-get install -y libpng-dev \
|
RUN apt-get update && apt-get install -y libpng-dev \
|
||||||
libicu-dev \
|
libicu-dev \
|
||||||
unzip \
|
unzip \
|
||||||
@ -18,10 +18,29 @@ RUN apt-get update && apt-get install -y libpng-dev \
|
|||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ && \
|
||||||
|
docker-php-ext-install -j$(nproc) zip bcmath ldap gd pdo_pgsql pdo_mysql intl opcache && \
|
||||||
|
pecl install memcached-3.1.3 && \
|
||||||
|
docker-php-ext-enable memcached && \
|
||||||
|
a2enmod rewrite && a2enmod ssl && \
|
||||||
|
echo "de_DE.UTF-8 UTF-8\nen_US.UTF-8 UTF-8\nes_ES.UTF-8 UTF-8\nfr_FR.UTF-8 UTF-8\nid_ID.UTF-8 UTF-8\nit_IT.UTF-8 UTF-8\nnl_NL.UTF-8 UTF-8\npl_PL.UTF-8 UTF-8\npt_BR.UTF-8 UTF-8\nru_RU.UTF-8 UTF-8\ntr_TR.UTF-8 UTF-8\nzh_TW.UTF-8 UTF-8\nzh_CN.UTF-8 UTF-8\n\n" > /etc/locale.gen && \
|
||||||
|
locale-gen && \
|
||||||
|
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
|
|
||||||
|
# configure PHP
|
||||||
|
RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini && \
|
||||||
|
sed -i 's/max_execution_time = 30/max_execution_time = 600/' /usr/local/etc/php/php.ini && \
|
||||||
|
sed -i 's/memory_limit = 128M/memory_limit = 512M/' /usr/local/etc/php/php.ini
|
||||||
|
|
||||||
# Copy in Firefly III source
|
# Copy in Firefly III source
|
||||||
WORKDIR $FIREFLY_PATH
|
WORKDIR $FIREFLY_PATH
|
||||||
ADD . $FIREFLY_PATH
|
ADD . $FIREFLY_PATH
|
||||||
|
|
||||||
|
# Ensure correct app directory permission, then `composer install`
|
||||||
|
RUN chown -R www-data:www-data /var/www && \
|
||||||
|
chmod -R 775 $FIREFLY_PATH/storage && \
|
||||||
|
composer install --prefer-dist --no-dev --no-scripts --no-suggest
|
||||||
|
|
||||||
# copy ca certs to correct location
|
# copy ca certs to correct location
|
||||||
COPY ./.deploy/docker/cacert.pem /usr/local/ssl/cert.pem
|
COPY ./.deploy/docker/cacert.pem /usr/local/ssl/cert.pem
|
||||||
|
|
||||||
@ -31,25 +50,6 @@ COPY ./.deploy/docker/apache2.conf /etc/apache2/apache2.conf
|
|||||||
# Enable default site (Firefly III)
|
# Enable default site (Firefly III)
|
||||||
COPY ./.deploy/docker/apache-firefly.conf /etc/apache2/sites-available/000-default.conf
|
COPY ./.deploy/docker/apache-firefly.conf /etc/apache2/sites-available/000-default.conf
|
||||||
|
|
||||||
# Run a lot of installation commands:
|
|
||||||
RUN chown -R www-data:www-data /var/www && \
|
|
||||||
chmod -R 775 $FIREFLY_PATH/storage && \
|
|
||||||
a2enmod rewrite && a2enmod ssl && \
|
|
||||||
docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ && \
|
|
||||||
docker-php-ext-install -j$(nproc) zip bcmath ldap gd pdo_pgsql pdo_mysql intl opcache && \
|
|
||||||
pecl install memcached-3.1.3 && \
|
|
||||||
docker-php-ext-enable memcached && \
|
|
||||||
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
|
|
||||||
echo "de_DE.UTF-8 UTF-8\nen_US.UTF-8 UTF-8\nes_ES.UTF-8 UTF-8\nfr_FR.UTF-8 UTF-8\nid_ID.UTF-8 UTF-8\nit_IT.UTF-8 UTF-8\nnl_NL.UTF-8 UTF-8\npl_PL.UTF-8 UTF-8\npt_BR.UTF-8 UTF-8\nru_RU.UTF-8 UTF-8\ntr_TR.UTF-8 UTF-8\nzh_TW.UTF-8 UTF-8\nzh_CN.UTF-8 UTF-8\n\n" > /etc/locale.gen && \
|
|
||||||
locale-gen && \
|
|
||||||
composer install --prefer-dist --no-dev --no-scripts --no-suggest
|
|
||||||
|
|
||||||
# configure PHP
|
|
||||||
RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini && \
|
|
||||||
sed -i 's/max_execution_time = 30/max_execution_time = 600/' /usr/local/etc/php/php.ini && \
|
|
||||||
sed -i 's/memory_limit = 128M/memory_limit = 512M/' /usr/local/etc/php/php.ini
|
|
||||||
|
|
||||||
|
|
||||||
# Expose port 80
|
# Expose port 80
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
FROM arm32v7/php:7.2.8-apache-stretch
|
FROM php:7.2-apache
|
||||||
ARG ARCH
|
ARG ARCH
|
||||||
COPY tmp/qemu-arm-static /usr/bin/qemu-arm-static
|
|
||||||
ENV FIREFLY_PATH=/var/www/firefly-iii COMPOSER_ALLOW_SUPERUSER=1
|
ENV FIREFLY_PATH=/var/www/firefly-iii COMPOSER_ALLOW_SUPERUSER=1
|
||||||
LABEL version="1.4" maintainer="thegrumpydictator@gmail.com"
|
LABEL version="1.4" maintainer="thegrumpydictator@gmail.com"
|
||||||
|
|
||||||
# Create volumes
|
# Create volumes
|
||||||
VOLUME $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload
|
VOLUME $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload
|
||||||
|
|
||||||
# Install some stuff
|
# Install stuffs Firefly run & depends on: php extensions, locales, dev headers and composer
|
||||||
RUN apt-get update && apt-get install -y libpng-dev \
|
RUN apt-get update && apt-get install -y libpng-dev \
|
||||||
libicu-dev \
|
libicu-dev \
|
||||||
unzip \
|
unzip \
|
||||||
@ -15,12 +14,33 @@ RUN apt-get update && apt-get install -y libpng-dev \
|
|||||||
libldap2-dev \
|
libldap2-dev \
|
||||||
libpq-dev \
|
libpq-dev \
|
||||||
locales \
|
locales \
|
||||||
libmemcached-dev
|
libmemcached-dev && \
|
||||||
|
apt-get clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ && \
|
||||||
|
docker-php-ext-install -j$(nproc) zip bcmath ldap gd pdo_pgsql pdo_mysql intl opcache && \
|
||||||
|
pecl install memcached-3.1.3 && \
|
||||||
|
docker-php-ext-enable memcached && \
|
||||||
|
a2enmod rewrite && a2enmod ssl && \
|
||||||
|
echo "de_DE.UTF-8 UTF-8\nen_US.UTF-8 UTF-8\nes_ES.UTF-8 UTF-8\nfr_FR.UTF-8 UTF-8\nid_ID.UTF-8 UTF-8\nit_IT.UTF-8 UTF-8\nnl_NL.UTF-8 UTF-8\npl_PL.UTF-8 UTF-8\npt_BR.UTF-8 UTF-8\nru_RU.UTF-8 UTF-8\ntr_TR.UTF-8 UTF-8\nzh_TW.UTF-8 UTF-8\nzh_CN.UTF-8 UTF-8\n\n" > /etc/locale.gen && \
|
||||||
|
locale-gen && \
|
||||||
|
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
|
|
||||||
|
# configure PHP
|
||||||
|
RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini && \
|
||||||
|
sed -i 's/max_execution_time = 30/max_execution_time = 600/' /usr/local/etc/php/php.ini && \
|
||||||
|
sed -i 's/memory_limit = 128M/memory_limit = 512M/' /usr/local/etc/php/php.ini
|
||||||
|
|
||||||
# Copy in Firefly III source
|
# Copy in Firefly III source
|
||||||
WORKDIR $FIREFLY_PATH
|
WORKDIR $FIREFLY_PATH
|
||||||
ADD . $FIREFLY_PATH
|
ADD . $FIREFLY_PATH
|
||||||
|
|
||||||
|
# Ensure correct app directory permission, then `composer install`
|
||||||
|
RUN chown -R www-data:www-data /var/www && \
|
||||||
|
chmod -R 775 $FIREFLY_PATH/storage && \
|
||||||
|
composer install --prefer-dist --no-dev --no-scripts --no-suggest
|
||||||
|
|
||||||
# copy ca certs to correct location
|
# copy ca certs to correct location
|
||||||
COPY ./.deploy/docker/cacert.pem /usr/local/ssl/cert.pem
|
COPY ./.deploy/docker/cacert.pem /usr/local/ssl/cert.pem
|
||||||
|
|
||||||
@ -30,19 +50,6 @@ COPY ./.deploy/docker/apache2.conf /etc/apache2/apache2.conf
|
|||||||
# Enable default site (Firefly III)
|
# Enable default site (Firefly III)
|
||||||
COPY ./.deploy/docker/apache-firefly.conf /etc/apache2/sites-available/000-default.conf
|
COPY ./.deploy/docker/apache-firefly.conf /etc/apache2/sites-available/000-default.conf
|
||||||
|
|
||||||
# Run a lot of installation commands:
|
|
||||||
RUN chown -R www-data:www-data /var/www && \
|
|
||||||
chmod -R 775 $FIREFLY_PATH/storage && \
|
|
||||||
a2enmod rewrite && a2enmod ssl && \
|
|
||||||
docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ && \
|
|
||||||
docker-php-ext-install -j$(nproc) zip bcmath ldap gd pdo_pgsql pdo_mysql intl opcache && \
|
|
||||||
pecl install memcached-3.1.3 && \
|
|
||||||
docker-php-ext-enable memcached && \
|
|
||||||
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
|
|
||||||
echo "de_DE.UTF-8 UTF-8\nen_US.UTF-8 UTF-8\nes_ES.UTF-8 UTF-8\nfr_FR.UTF-8 UTF-8\nid_ID.UTF-8 UTF-8\nit_IT.UTF-8 UTF-8\nnl_NL.UTF-8 UTF-8\npl_PL.UTF-8 UTF-8\npt_BR.UTF-8 UTF-8\nru_RU.UTF-8 UTF-8\ntr_TR.UTF-8 UTF-8\nzh_TW.UTF-8 UTF-8\nzh_CN.UTF-8 UTF-8\n\n" > /etc/locale.gen && \
|
|
||||||
locale-gen && \
|
|
||||||
composer install --prefer-dist --no-dev --no-scripts --no-suggest
|
|
||||||
|
|
||||||
# Expose port 80
|
# Expose port 80
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user