2017-12-15 02:16:41 -06:00
|
|
|
# use PHP 7.1 and Apache as a base.
|
2017-12-07 11:46:52 -06:00
|
|
|
FROM php:7.1-apache
|
2016-10-26 08:01:55 -05:00
|
|
|
|
2017-12-15 02:16:41 -06:00
|
|
|
# set working dir
|
|
|
|
ENV FIREFLY_PATH /var/www/firefly-iii
|
2018-05-25 03:10:08 -05:00
|
|
|
ENV CURL_VERSION 7.60.0
|
|
|
|
ENV OPENSSL_VERSION 1.1.1-pre6
|
2017-12-15 02:16:41 -06:00
|
|
|
WORKDIR $FIREFLY_PATH
|
|
|
|
ADD . $FIREFLY_PATH
|
|
|
|
|
|
|
|
# install packages
|
2016-10-26 08:01:55 -05:00
|
|
|
RUN apt-get update -y && \
|
|
|
|
apt-get install -y --no-install-recommends libcurl4-openssl-dev \
|
|
|
|
zlib1g-dev \
|
|
|
|
libjpeg62-turbo-dev \
|
2018-05-25 03:06:45 -05:00
|
|
|
wget \
|
|
|
|
libpng-dev \
|
2016-10-26 08:01:55 -05:00
|
|
|
libicu-dev \
|
|
|
|
libedit-dev \
|
|
|
|
libtidy-dev \
|
|
|
|
libxml2-dev \
|
|
|
|
libsqlite3-dev \
|
2017-06-05 17:22:09 -05:00
|
|
|
libpq-dev \
|
2017-01-11 17:30:33 -06:00
|
|
|
libbz2-dev \
|
2017-02-10 21:33:20 -06:00
|
|
|
gettext-base \
|
2018-07-02 23:03:38 -05:00
|
|
|
cron \
|
2017-01-11 17:30:33 -06:00
|
|
|
locales && \
|
2017-12-15 02:16:41 -06:00
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2016-10-26 08:01:55 -05:00
|
|
|
|
2018-05-25 03:07:26 -05:00
|
|
|
# Setup the Composer installer
|
|
|
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
2018-05-25 03:10:08 -05:00
|
|
|
|
|
|
|
# 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 && \
|
|
|
|
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 && \
|
|
|
|
make && \
|
|
|
|
make install
|
|
|
|
|
2018-07-02 23:03:38 -05:00
|
|
|
|
|
|
|
# Create the log file to be able to run tail
|
|
|
|
RUN touch /var/log/cron.log
|
|
|
|
|
|
|
|
# Setup cron job
|
|
|
|
RUN (crontab -l ; echo "* * * * * root $FIREFLY_PATH/artisan schedule:run >> /var/log/cron.log") | crontab
|
|
|
|
|
2017-12-15 02:16:41 -06:00
|
|
|
# Install PHP exentions.
|
2017-12-07 11:46:52 -06:00
|
|
|
RUN docker-php-ext-install -j$(nproc) curl gd intl json readline tidy zip bcmath xml mbstring pdo_sqlite pdo_mysql bz2 pdo_pgsql
|
2016-10-26 08:01:55 -05:00
|
|
|
|
2017-12-15 02:16:41 -06:00
|
|
|
# Generate locales supported by Firefly III
|
2018-04-26 14:16:45 -05:00
|
|
|
RUN 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-8pt_BR.UTF-8 UTF-8ru_RU.UTF-8 UTF-8\ntr_TR.UTF-8 UTF-8\n\n" > /etc/locale.gen && locale-gen
|
2017-01-11 17:30:33 -06:00
|
|
|
|
2017-12-15 02:16:41 -06:00
|
|
|
# copy Apache config to correct spot.
|
2018-03-11 12:27:30 -05:00
|
|
|
COPY ./.deploy/docker/apache2.conf /etc/apache2/apache2.conf
|
2017-09-09 05:46:35 -05:00
|
|
|
|
2016-10-26 08:01:55 -05:00
|
|
|
# Enable apache mod rewrite..
|
|
|
|
RUN a2enmod rewrite
|
|
|
|
|
2017-09-17 08:42:29 -05:00
|
|
|
# Enable apache mod ssl..
|
|
|
|
RUN a2enmod ssl
|
|
|
|
|
2017-12-15 02:16:41 -06:00
|
|
|
# Create volumes for several directories:
|
|
|
|
VOLUME $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload
|
|
|
|
|
|
|
|
# Enable default site (Firefly III)
|
2018-03-11 12:27:30 -05:00
|
|
|
COPY ./.deploy/docker/apache-firefly.conf /etc/apache2/sites-available/000-default.conf
|
2016-10-26 08:01:55 -05:00
|
|
|
|
2017-12-15 02:16:41 -06:00
|
|
|
# Make sure we own Firefly III directory
|
2017-09-09 06:17:01 -05:00
|
|
|
RUN chown -R www-data:www-data /var/www && chmod -R 775 $FIREFLY_PATH/storage
|
2017-09-09 05:46:35 -05:00
|
|
|
|
2017-12-15 02:16:41 -06:00
|
|
|
# Run composer
|
|
|
|
RUN composer install --prefer-dist --no-dev --no-scripts --no-suggest
|
2017-09-09 05:46:35 -05:00
|
|
|
|
2017-12-15 02:16:41 -06:00
|
|
|
# Expose port 80
|
2017-08-31 14:05:43 -05:00
|
|
|
EXPOSE 80
|
2017-09-09 05:46:35 -05:00
|
|
|
|
2018-07-02 23:03:38 -05:00
|
|
|
# Run the command on container startup
|
|
|
|
CMD cron
|
|
|
|
|
2017-12-15 02:16:41 -06:00
|
|
|
# Run entrypoint thing
|
2018-05-25 03:07:09 -05:00
|
|
|
ENTRYPOINT [".deploy/docker/entrypoint.sh"]
|
|
|
|
|