firefly-iii/Dockerfile

35 lines
1.3 KiB
Docker
Raw Normal View History

2018-08-11 00:22:17 -05:00
FROM webdevops/php-nginx:7.2
2016-10-26 08:01:55 -05:00
2018-08-11 00:22:17 -05:00
ENV FIREFLY_PATH /app
2017-12-15 02:16:41 -06:00
WORKDIR $FIREFLY_PATH
ADD . $FIREFLY_PATH
2018-08-11 00:22:17 -05:00
# gettext is used to update the .env file when the container launches.
RUN apt-get update -y && apt-get install -y --no-install-recommends gettext-base && apt-get clean
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-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
# Make sure we own Firefly III directory
2018-08-13 11:10:02 -05:00
RUN chown -R $APPLICATION_GID:$APPLICATION_UID /var/www && chmod -R 775 $FIREFLY_PATH/storage
2018-08-12 02:34:03 -05:00
# Add cron job
RUN docker-service enable cron
2018-08-13 11:10:02 -05:00
RUN docker-cronjob '0 3 * * * application cd /app/ && php artisan firefly:cron'
2018-08-12 02:34:03 -05:00
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-11 00:22:17 -05:00
# Copy nginx config to correct spot.
COPY ./.deploy/docker/vhost.conf /opt/docker/etc/nginx/vhost.conf
2018-08-11 00:22:17 -05:00
# Copy entrypoint script to correct spot:
COPY ./.deploy/docker/entrypoint.sh /opt/docker/provision/entrypoint.d/default.sh