First version of Dockerfile

Added scripts and configs from Firefly docker deploy
This commit is contained in:
Andreas Ihrig 2018-11-08 16:32:06 +01:00
parent f9fe8e7233
commit 9e8ae23806
9 changed files with 178 additions and 0 deletions

5
.dockerignore Normal file
View File

@ -0,0 +1,5 @@
.git
.gitignore
.dockerignore
node_modules

2
CHANGELOG Normal file
View File

@ -0,0 +1,2 @@
[0.1.0]
* Initial version

22
CloudronManifest.json Normal file
View File

@ -0,0 +1,22 @@
{
"id": "org.firefly-iii.coudronapp",
"title": "Firefly III",
"author": "Firefly developers",
"description": "file://DESCRIPTION.md",
"changelog": "file://CHANGELOG",
"tagline": "A personal finances manager",
"version": "4.7.8",
"healthCheckPath": "/",
"httpPort": 3000,
"addons": {
"localstorage": {}
},
"manifestVersion": 1,
"website": "https://firefly-iii.org/",
"contactEmail": "thegrumpydictator@gmail.com",
"icon": "",
"tags": [
"changeme"
],
"mediaLinks": [ ]
}

1
DESCRIPTION.md Normal file
View File

@ -0,0 +1 @@
Please add the appstore description in markdown format here.

88
Dockerfile Normal file
View File

@ -0,0 +1,88 @@
FROM cloudron/base:1.0.0@sha256:147a648a068a2e746644746bbfb42eb7a50d682437cead3c67c933c546357617
# Many lines are copied from https://github.com/firefly-iii/firefly-iii/blob/master/Dockerfile
ENV FIREFLY_VERSION 4.7.8
ENV FIREFLY_PATH /app/code
ENV CURL_VERSION 7.60.0
ENV OPENSSL_VERSION 1.1.1-pre6
ENV COMPOSER_ALLOW_SUPERUSER 1
LABEL version="1.0" maintainer="robomod@xeac.org"
## Prepare third parties
# Install packages
RUN apt-get update -y && \
apt-get install -y --no-install-recommends libjpeg62-turbo-dev \
libpng-dev \
libldap2-dev \
libedit-dev \
libtidy-dev \
libsqlite3-dev \
libbz2-dev \
cron \
rsyslog \
locales && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# LDAP install
RUN docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && docker-php-ext-install ldap
# 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
# 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
## Configure system
# Generate locales supported by Firefly III
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
# Supervisor conf
ADD supervisor/ /etc/supervisor/conf.d/
# Enable apache mod rewrite and ssl
RUN a2enmod rewrite
RUN a2enmod ssl
# Firefly apache conf
ADD apache-firefly.conf /etc/apache2/sites-available/000-default.conf
# Start script
ADD start.sh /app/code/start.sh
## Install software
# Create app code directory
RUN mkdir -p /app/code
WORKDIR /app/code
# Get Firefly
RUN wget "https://github.com/firefly-iii/firefly-iii/archive/${FIREFLY_VERSION}.tar.gz" -O - \
| tar -xz -C /app/code --strip-components=1
# Run composer
RUN composer install --prefer-dist --no-dev --no-scripts --no-suggest
# Expose port
EXPOSE 3000
# Run start script
CMD [ "/app/code/start.sh" ]

14
apache-firefly.conf Normal file
View File

@ -0,0 +1,14 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /app/code
ErrorLog "|/bin/cat"
CustomLog "|/bin/cat" combined
<Directory /app/code>
Options -Indexes +FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>

29
start.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
# make sure the correct directories exists (suggested by @chrif):
mkdir -p $FIREFLY_PATH/storage/app
mkdir -p $FIREFLY_PATH/storage/app/public
mkdir -p $FIREFLY_PATH/storage/build
mkdir -p $FIREFLY_PATH/storage/database
mkdir -p $FIREFLY_PATH/storage/debugbar
mkdir -p $FIREFLY_PATH/storage/export
mkdir -p $FIREFLY_PATH/storage/framework/cache
mkdir -p $FIREFLY_PATH/storage/framework/sessions
mkdir -p $FIREFLY_PATH/storage/framework/testing
mkdir -p $FIREFLY_PATH/storage/framework/views
mkdir -p $FIREFLY_PATH/storage/logs
mkdir -p $FIREFLY_PATH/storage/upload
# make sure we own the volumes:
chown -R www-data:www-data -R $FIREFLY_PATH/storage
chmod -R 775 $FIREFLY_PATH/storage
# remove any lingering files that may break upgrades:
rm -f $FIREFLY_PATH/storage/logs/laravel.log
cat .env.docker | envsubst > .env
composer dump-autoload
php artisan package:discover
php artisan firefly:instructions install
exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf --nodaemon

11
supervisor/cronjob.conf Normal file
View File

@ -0,0 +1,11 @@
[program:cron]
command=/usr/sbin/cron -f -L 15
user=root
autostart=true
autorestart=true
stdout_events_enabled=true
stderr_events_enabled=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
startsecs=10
startretries=3

View File

@ -0,0 +1,6 @@
[program:apache2]
command=/bin/bash -c "source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND"
stdout_events_enabled=true
stderr_events_enabled=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0