firefly-iii/Dockerfile

115 lines
4.3 KiB
Docker
Raw Normal View History

2018-09-27 09:35:24 -05:00
FROM php:7.2-apache
2018-08-14 14:21:03 -05:00
# If building on a RPi, use --build-arg cores=3 to use all cores when compiling
# to speed up the image build
ARG CORES
ENV CORES ${CORES:-1}
2016-10-26 08:01:55 -05:00
2018-08-15 12:10:00 -05:00
ENV FIREFLY_PATH /var/www/firefly-iii/
2018-08-15 07:43:49 -05:00
ENV CURL_VERSION 7.60.0
ENV OPENSSL_VERSION 1.1.1-pre6
2017-12-15 02:16:41 -06:00
LABEL version="1.0" maintainer="thegrumpydictator@gmail.com"
2018-08-14 14:21:03 -05:00
# install packages
RUN apt-get update -y && \
apt-get install -y --no-install-recommends libcurl4-openssl-dev \
zlib1g-dev \
libjpeg62-turbo-dev \
wget \
libpng-dev \
libicu-dev \
libedit-dev \
libtidy-dev \
libxml2-dev \
2018-08-18 07:08:28 -05:00
unzip \
2018-08-14 14:21:03 -05:00
libsqlite3-dev \
2018-08-18 07:08:28 -05:00
nano \
2018-08-14 14:21:03 -05:00
libpq-dev \
libbz2-dev \
gettext-base \
cron \
rsyslog \
2018-08-18 07:08:28 -05:00
supervisor \
2018-08-14 14:21:03 -05:00
locales && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install latest curl
RUN cd /tmp && \
wget https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz && \
tar -xvf openssl-${OPENSSL_VERSION}.tar.gz && \
cd openssl-${OPENSSL_VERSION} && \
./config && \
make -j${CORES} && \
make install
RUN cd /tmp && \
wget https://curl.haxx.se/download/curl-${CURL_VERSION}.tar.gz && \
tar -xvf curl-${CURL_VERSION}.tar.gz && \
cd curl-${CURL_VERSION} && \
./configure --with-ssl --host=$(gcc -dumpmachine) && \
make -j${CORES} && \
make install
# Make sure that libcurl is using the newer curl libaries
RUN echo "/usr/local/lib" >> /etc/ld.so.conf.d/00-curl.conf && ldconfig
2018-08-18 07:08:28 -05:00
# Mimic the Debian/Ubuntu config file structure for supervisor
COPY .deploy/docker/supervisord.conf /etc/supervisor/supervisord.conf
RUN mkdir -p /etc/supervisor/conf.d /var/log/supervisor
2018-08-14 14:21:03 -05:00
2018-08-18 07:08:28 -05:00
# copy Firefly III supervisor conf file.
COPY ./.deploy/docker/firefly-iii.conf /etc/supervisor/conf.d/firefly-iii.conf
# copy cron job supervisor conf file.
COPY ./.deploy/docker/cronjob.conf /etc/supervisor/conf.d/cronjob.conf
# test crons added via crontab
RUN echo "0 3 * * * /usr/local/bin/php /var/www/firefly-iii/artisan firefly:cron" | crontab -
#RUN (crontab -l ; echo "*/1 * * * * free >> /var/www/firefly-iii/public/cron.html") 2>&1 | crontab -
2018-08-14 14:21:03 -05:00
# Install PHP exentions.
RUN docker-php-ext-install -j$(nproc) gd intl tidy zip bcmath pdo_mysql bz2 pdo_pgsql
2016-10-26 08:01:55 -05:00
2018-08-11 00:22:17 -05:00
# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
2017-12-15 02:16:41 -06:00
# Generate locales supported by Firefly III
2018-07-17 23:30:56 -05:00
RUN echo "en_US.UTF-8 UTF-8\nde_DE.UTF-8 UTF-8\nfr_FR.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\n\n" > /etc/locale.gen && locale-gen
2018-08-14 14:21:03 -05:00
# copy Apache config to correct spot.
COPY ./.deploy/docker/apache2.conf /etc/apache2/apache2.conf
# Enable apache mod rewrite..
RUN a2enmod rewrite
# Enable apache mod ssl..
RUN a2enmod ssl
2018-08-11 00:22:17 -05:00
# Create volumes
2017-12-15 02:16:41 -06:00
VOLUME $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload
2018-08-14 14:21:03 -05:00
# Enable default site (Firefly III)
COPY ./.deploy/docker/apache-firefly.conf /etc/apache2/sites-available/000-default.conf
2017-12-15 02:16:41 -06:00
# Make sure we own Firefly III directory
2018-08-17 14:12:26 -05:00
RUN chown -R www-data:www-data /var/www && chmod -R 775 $FIREFLY_PATH/storage
2018-08-15 07:43:49 -05:00
# Copy in Firefly Source
WORKDIR $FIREFLY_PATH
ADD . $FIREFLY_PATH
2018-09-03 07:51:15 -05:00
# Fix the link to curl:
RUN rm -rf /usr/local/lib/libcurl.so.4 && ln -s /usr/lib/x86_64-linux-gnu/libcurl.so.4.4.0 /usr/local/lib/libcurl.so.4
2017-12-15 02:16:41 -06:00
# Run composer
2018-08-11 00:22:17 -05:00
ENV COMPOSER_ALLOW_SUPERUSER 1
2017-12-15 02:16:41 -06:00
RUN composer install --prefer-dist --no-dev --no-scripts --no-suggest
2018-08-14 14:21:03 -05:00
# Expose port 80
EXPOSE 80
2018-08-14 14:21:03 -05:00
# Run entrypoint thing
2018-08-20 10:31:39 -05:00
ENTRYPOINT [".deploy/docker/entrypoint.sh"]