mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
New docker related files.
This commit is contained in:
parent
11b5a0294e
commit
54ecfac550
33
Dockerfile
33
Dockerfile
@ -1,5 +1,12 @@
|
|||||||
|
# use PHP 7.1 and Apache as a base.
|
||||||
FROM php:7.1-apache
|
FROM php:7.1-apache
|
||||||
|
|
||||||
|
# set working dir
|
||||||
|
ENV FIREFLY_PATH /var/www/firefly-iii
|
||||||
|
WORKDIR $FIREFLY_PATH
|
||||||
|
ADD . $FIREFLY_PATH
|
||||||
|
|
||||||
|
# install packages
|
||||||
RUN apt-get update -y && \
|
RUN apt-get update -y && \
|
||||||
apt-get install -y --no-install-recommends libcurl4-openssl-dev \
|
apt-get install -y --no-install-recommends libcurl4-openssl-dev \
|
||||||
zlib1g-dev \
|
zlib1g-dev \
|
||||||
@ -14,14 +21,16 @@ RUN apt-get update -y && \
|
|||||||
libbz2-dev \
|
libbz2-dev \
|
||||||
gettext-base \
|
gettext-base \
|
||||||
locales && \
|
locales && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Install PHP exentions.
|
||||||
RUN docker-php-ext-install -j$(nproc) curl gd intl json readline tidy zip bcmath xml mbstring pdo_sqlite pdo_mysql bz2 pdo_pgsql
|
RUN docker-php-ext-install -j$(nproc) curl gd intl json readline tidy zip bcmath xml mbstring pdo_sqlite pdo_mysql bz2 pdo_pgsql
|
||||||
|
|
||||||
# Generate locales supported by firefly
|
# Generate locales supported by Firefly III
|
||||||
RUN echo "en_US.UTF-8 UTF-8\nde_DE.UTF-8 UTF-8\nnl_NL.UTF-8 UTF-8\npt_BR.UTF-8 UTF-8" > /etc/locale.gen && locale-gen
|
RUN echo "en_US.UTF-8 UTF-8\nde_DE.UTF-8 UTF-8\nnl_NL.UTF-8 UTF-8\npt_BR.UTF-8 UTF-8" > /etc/locale.gen && locale-gen
|
||||||
|
|
||||||
|
# copy Apache config to correct spot.
|
||||||
COPY ./docker/apache2.conf /etc/apache2/apache2.conf
|
COPY ./docker/apache2.conf /etc/apache2/apache2.conf
|
||||||
|
|
||||||
# Enable apache mod rewrite..
|
# Enable apache mod rewrite..
|
||||||
@ -30,23 +39,23 @@ RUN a2enmod rewrite
|
|||||||
# Enable apache mod ssl..
|
# Enable apache mod ssl..
|
||||||
RUN a2enmod ssl
|
RUN a2enmod ssl
|
||||||
|
|
||||||
|
# Create volumes for several directories:
|
||||||
|
VOLUME $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload
|
||||||
|
|
||||||
# Setup the Composer installer
|
# Setup the Composer installer
|
||||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
|
|
||||||
# Copy Apache Configs
|
# Enable default site (Firefly III)
|
||||||
COPY ./docker/apache-firefly.conf /etc/apache2/sites-available/000-default.conf
|
COPY ./docker/apache-firefly.conf /etc/apache2/sites-available/000-default.conf
|
||||||
|
|
||||||
ENV FIREFLY_PATH /var/www/firefly-iii
|
# Make sure we own Firefly III directory
|
||||||
|
|
||||||
WORKDIR $FIREFLY_PATH
|
|
||||||
|
|
||||||
# The working directory
|
|
||||||
COPY . $FIREFLY_PATH
|
|
||||||
|
|
||||||
RUN chown -R www-data:www-data /var/www && chmod -R 775 $FIREFLY_PATH/storage
|
RUN chown -R www-data:www-data /var/www && chmod -R 775 $FIREFLY_PATH/storage
|
||||||
|
|
||||||
RUN composer install --prefer-dist --no-dev --no-scripts
|
# Run composer
|
||||||
|
RUN composer install --prefer-dist --no-dev --no-scripts --no-suggest
|
||||||
|
|
||||||
|
# Expose port 80
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
# Run entrypoint thing
|
||||||
ENTRYPOINT ["docker/entrypoint.sh"]
|
ENTRYPOINT ["docker/entrypoint.sh"]
|
6
docker/docker.env
Normal file
6
docker/docker.env
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FF_APP_ENV=local
|
||||||
|
FF_APP_KEY=S0m3R@nd0mString0f32Ch@rsEx@ct1y
|
||||||
|
FF_DB_HOST=
|
||||||
|
FF_DB_NAME=
|
||||||
|
FF_DB_USER=
|
||||||
|
FF_DB_PASSWORD=
|
@ -1,5 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# make sure we own the volumes:
|
||||||
|
chown -R www-data:www-data $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload
|
||||||
|
chmod -R 775 $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload
|
||||||
|
|
||||||
cat .env.docker | envsubst > .env && cat .env
|
cat .env.docker | envsubst > .env && cat .env
|
||||||
composer dump-autoload
|
composer dump-autoload
|
||||||
|
Loading…
Reference in New Issue
Block a user