mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2026-01-06 14:37:26 +01:00
Compare commits
40 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f175fa4fb0 | ||
|
|
0d93596cde | ||
|
|
10aaf3fb6e | ||
|
|
8117d0c5bd | ||
|
|
fef92891cb | ||
|
|
7f415803fb | ||
|
|
1caa8c7e70 | ||
|
|
e35653fe59 | ||
|
|
4d7cc8e464 | ||
|
|
c6e122b81f | ||
|
|
421a1f10e6 | ||
|
|
84db77cde8 | ||
|
|
e8706de11c | ||
|
|
960a85d8a7 | ||
|
|
6cd85f48cd | ||
|
|
eca3af3da5 | ||
|
|
b141cfe449 | ||
|
|
3104ec0be9 | ||
|
|
acd778f815 | ||
|
|
0641860c3f | ||
|
|
f6564ffb14 | ||
|
|
d751217d9a | ||
|
|
9bd40b98df | ||
|
|
54f789d5a1 | ||
|
|
a6644abaa2 | ||
|
|
d42e333248 | ||
|
|
2e4ccb920b | ||
|
|
ebe353ca52 | ||
|
|
1af91f451d | ||
|
|
386f6ed8c1 | ||
|
|
73e88f6042 | ||
|
|
758709a796 | ||
|
|
a67de32b6e | ||
|
|
49d3e562de | ||
|
|
7d4afadbb5 | ||
|
|
3709355309 | ||
|
|
4b63e1f76d | ||
|
|
5118eac0ea | ||
|
|
486d38d6e1 | ||
|
|
89ae36315d |
@@ -11,6 +11,10 @@
|
|||||||
:hammer: Fully production-ready through docker-compose
|
:hammer: Fully production-ready through docker-compose
|
||||||
:pencil: Adjustable to your needs via environment variable
|
:pencil: Adjustable to your needs via environment variable
|
||||||
|
|
||||||
|
## You want some Kubernetes + Helm with that?
|
||||||
|
[Helm Chat](https://github.com/Saddamus/invoiceninja-helm) by @Saddamus
|
||||||
|
[Kubernetes](https://github.com/invoiceninja/dockerfiles/issues/94) by @spacepluk
|
||||||
|
|
||||||
## Quickstart V5 Launch
|
## Quickstart V5 Launch
|
||||||
|
|
||||||
The dockerfile has been revamped to make is easier to get started, by default the base image selected in 5 which will pull in the latest v5 stable image.
|
The dockerfile has been revamped to make is easier to get started, by default the base image selected in 5 which will pull in the latest v5 stable image.
|
||||||
|
|||||||
@@ -17,32 +17,21 @@ ENV BAK_PUBLIC_PATH $BAK_PUBLIC_PATH
|
|||||||
WORKDIR /var/www/app
|
WORKDIR /var/www/app
|
||||||
|
|
||||||
COPY entrypoint.sh /usr/local/bin/docker-entrypoint
|
COPY entrypoint.sh /usr/local/bin/docker-entrypoint
|
||||||
RUN chmod +x /usr/local/bin/docker-entrypoint
|
RUN chmod +x /usr/local/bin/docker-entrypoint \
|
||||||
|
&& mv /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini
|
||||||
|
|
||||||
RUN set -eux; \
|
# Install PHP extensions
|
||||||
apk add --no-cache \
|
# https://hub.docker.com/r/mlocati/php-extension-installer/tags
|
||||||
gmp-dev \
|
COPY --from=mlocati/php-extension-installer:1.1.41 /usr/bin/install-php-extensions /usr/local/bin/
|
||||||
freetype-dev \
|
|
||||||
libarchive-tools \
|
|
||||||
libjpeg-turbo-dev \
|
|
||||||
libpng-dev \
|
|
||||||
libwebp-dev\
|
|
||||||
libzip-dev
|
|
||||||
|
|
||||||
RUN docker-php-ext-configure gd --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include --with-webp-dir=/usr/include --with-freetype-dir=/usr/include/; \
|
RUN install-php-extensions \
|
||||||
docker-php-ext-configure zip --with-libzip; \
|
gd \
|
||||||
docker-php-ext-install -j$(nproc) \
|
gmp \
|
||||||
iconv \
|
opcache \
|
||||||
gd \
|
pdo_mysql \
|
||||||
gmp \
|
zip
|
||||||
mbstring \
|
|
||||||
opcache \
|
|
||||||
pdo \
|
|
||||||
pdo_mysql \
|
|
||||||
zip
|
|
||||||
|
|
||||||
COPY ./config/php/php.ini /usr/local/etc/php/php.ini
|
COPY ./config/php/php.ini /usr/local/etc/php/conf.d/in-php.ini
|
||||||
COPY ./config/php/php-cli.ini /usr/local/etc/php/php-cli.ini
|
|
||||||
|
|
||||||
# Separate user
|
# Separate user
|
||||||
ENV INVOICENINJA_USER=invoiceninja
|
ENV INVOICENINJA_USER=invoiceninja
|
||||||
@@ -58,14 +47,15 @@ RUN addgroup --gid=1500 -S "$INVOICENINJA_USER" && \
|
|||||||
addgroup "$INVOICENINJA_USER" www-data; \
|
addgroup "$INVOICENINJA_USER" www-data; \
|
||||||
chown -R "$INVOICENINJA_USER":"$INVOICENINJA_USER" .
|
chown -R "$INVOICENINJA_USER":"$INVOICENINJA_USER" .
|
||||||
|
|
||||||
USER $INVOICENINJA_USER
|
USER 1500
|
||||||
|
|
||||||
# Download and install IN
|
# Download and install IN
|
||||||
ENV INVOICENINJA_VERSION="${INVOICENINJA_VERSION}"
|
ENV INVOICENINJA_VERSION="${INVOICENINJA_VERSION}"
|
||||||
|
|
||||||
RUN curl -s -o /tmp/ninja.zip -SL https://download.invoiceninja.com/ninja-v${INVOICENINJA_VERSION}.zip \
|
RUN curl -o /tmp/ninja.zip -L https://download.invoiceninja.com/ninja-v${INVOICENINJA_VERSION}.zip \
|
||||||
&& bsdtar --strip-components=1 -C /var/www/app -xf /tmp/ninja.zip \
|
&& unzip -q /tmp/ninja.zip -d /tmp/ \
|
||||||
&& rm /tmp/ninja.zip \
|
&& mv /tmp/ninja/* /var/www/app \
|
||||||
|
&& rm -rf /tmp/ninja* \
|
||||||
&& mv /var/www/app/storage $BAK_STORAGE_PATH \
|
&& mv /var/www/app/storage $BAK_STORAGE_PATH \
|
||||||
&& mv /var/www/app/public $BAK_PUBLIC_PATH \
|
&& mv /var/www/app/public $BAK_PUBLIC_PATH \
|
||||||
&& mkdir -p /var/www/app/public/logo /var/www/app/storage \
|
&& mkdir -p /var/www/app/public/logo /var/www/app/storage \
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ RUN set -eux; \
|
|||||||
curl
|
curl
|
||||||
|
|
||||||
# Download Invoice Ninja
|
# Download Invoice Ninja
|
||||||
RUN curl -o /tmp/ninja.tar.gz -LJ0 https://github.com/invoiceninja/invoiceninja/tarball/v$INVOICENINJA_VERSION \
|
RUN curl -o /tmp/ninja.tar.gz -L https://github.com/invoiceninja/invoiceninja/tarball/v$INVOICENINJA_VERSION \
|
||||||
&& mkdir -p /var/www/app \
|
&& mkdir -p /var/www/app \
|
||||||
&& tar --strip-components=1 -xf /tmp/ninja.tar.gz -C /var/www/app/ \
|
&& tar --strip-components=1 -xf /tmp/ninja.tar.gz -C /var/www/app/ \
|
||||||
&& mkdir -p /var/www/app/public/logo /var/www/app/storage \
|
&& mkdir -p /var/www/app/public/logo /var/www/app/storage \
|
||||||
@@ -28,7 +28,7 @@ RUN npm install --production \
|
|||||||
&& npm run production \
|
&& npm run production \
|
||||||
&& rm -rf node_modules \
|
&& rm -rf node_modules \
|
||||||
&& mv /var/www/app/storage $BAK_STORAGE_PATH \
|
&& mv /var/www/app/storage $BAK_STORAGE_PATH \
|
||||||
&& mv /var/www/app/public $BAK_PUBLIC_PATH
|
&& mv /var/www/app/public $BAK_PUBLIC_PATH
|
||||||
|
|
||||||
# Prepare php image
|
# Prepare php image
|
||||||
FROM php:${PHP_VERSION}-fpm-alpine
|
FROM php:${PHP_VERSION}-fpm-alpine
|
||||||
@@ -45,36 +45,35 @@ WORKDIR /var/www/app
|
|||||||
|
|
||||||
COPY --from=frontend /var/www/app /var/www/app
|
COPY --from=frontend /var/www/app /var/www/app
|
||||||
COPY entrypoint.sh /usr/local/bin/docker-entrypoint
|
COPY entrypoint.sh /usr/local/bin/docker-entrypoint
|
||||||
RUN chmod +x /usr/local/bin/docker-entrypoint
|
RUN chmod +x /usr/local/bin/docker-entrypoint \
|
||||||
|
&& mv /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini
|
||||||
|
|
||||||
|
# Install PHP extensions
|
||||||
|
# https://hub.docker.com/r/mlocati/php-extension-installer/tags
|
||||||
|
COPY --from=mlocati/php-extension-installer:1.1.41 /usr/bin/install-php-extensions /usr/local/bin/
|
||||||
|
|
||||||
|
RUN install-php-extensions \
|
||||||
|
bcmath \
|
||||||
|
exif \
|
||||||
|
gd \
|
||||||
|
gmp \
|
||||||
|
mysqli \
|
||||||
|
opcache \
|
||||||
|
pdo_mysql \
|
||||||
|
zip \
|
||||||
|
@composer
|
||||||
|
|
||||||
|
# Install chromium
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
|
supervisor \
|
||||||
mysql-client \
|
mysql-client \
|
||||||
freetype-dev \
|
|
||||||
gmp-dev \
|
|
||||||
libjpeg-turbo-dev \
|
|
||||||
libpng-dev \
|
|
||||||
libzip-dev \
|
|
||||||
# oniguruma-dev \
|
|
||||||
git \
|
git \
|
||||||
# busybox-suid \
|
|
||||||
zip \
|
|
||||||
chromium \
|
chromium \
|
||||||
harfbuzz \
|
ttf-freefont
|
||||||
ttf-freefont \
|
|
||||||
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|
||||||
&& docker-php-ext-install -j$(nproc) \
|
|
||||||
bcmath \
|
|
||||||
exif \
|
|
||||||
gd \
|
|
||||||
gmp \
|
|
||||||
mysqli \
|
|
||||||
opcache \
|
|
||||||
pdo_mysql \
|
|
||||||
zip
|
|
||||||
|
|
||||||
COPY ./config/php/php.ini /usr/local/etc/php/php.ini
|
COPY ./config/php/php.ini /usr/local/etc/php/conf.d/in-php.ini
|
||||||
COPY ./config/php/php-cli.ini /usr/local/etc/php/php-cli.ini
|
COPY ./config/supervisor/supervisord.conf /
|
||||||
|
|
||||||
## Separate user
|
## Separate user
|
||||||
ARG UID=1500
|
ARG UID=1500
|
||||||
@@ -89,11 +88,9 @@ RUN addgroup --gid=$UID -S "$INVOICENINJA_USER" \
|
|||||||
--no-create-home \
|
--no-create-home \
|
||||||
"$INVOICENINJA_USER" \
|
"$INVOICENINJA_USER" \
|
||||||
&& addgroup "$INVOICENINJA_USER" www-data \
|
&& addgroup "$INVOICENINJA_USER" www-data \
|
||||||
&& chown -R "$INVOICENINJA_USER":"$INVOICENINJA_USER" /var/www/app
|
&& mkdir /var/log/supervisord /var/run/supervisord \
|
||||||
|
&& chown -R "$INVOICENINJA_USER":"$INVOICENINJA_USER" /var/www/app \
|
||||||
|
&& chown $INVOICENINJA_USER:www-data /var/log/supervisord /var/run/supervisord
|
||||||
# Install Composer
|
|
||||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer;
|
|
||||||
|
|
||||||
USER $UID
|
USER $UID
|
||||||
|
|
||||||
@@ -105,4 +102,4 @@ ENV LOG errorlog
|
|||||||
ENV SNAPPDF_EXECUTABLE_PATH /usr/bin/chromium-browser
|
ENV SNAPPDF_EXECUTABLE_PATH /usr/bin/chromium-browser
|
||||||
|
|
||||||
ENTRYPOINT ["docker-entrypoint"]
|
ENTRYPOINT ["docker-entrypoint"]
|
||||||
CMD ["php-fpm"]
|
CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo "Early Entry"
|
|
||||||
|
|
||||||
cleanup ()
|
|
||||||
{
|
|
||||||
kill -s SIGTERM $!
|
|
||||||
exit 0
|
|
||||||
}
|
|
||||||
|
|
||||||
trap cleanup SIGINT SIGTERM
|
|
||||||
|
|
||||||
while :
|
|
||||||
do
|
|
||||||
sleep 60 ; cd /var/www/app/ && php artisan schedule:run;
|
|
||||||
done
|
|
||||||
10
config/mysql/Dockerfile
Normal file
10
config/mysql/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
FROM mysql:5
|
||||||
|
ENV force_color_prompt yes
|
||||||
|
|
||||||
|
RUN apt-get update;
|
||||||
|
RUN apt-get install -y cron;
|
||||||
|
|
||||||
|
ENTRYPOINT \
|
||||||
|
service cron start; \
|
||||||
|
printenv | grep -v "no_proxy" >> /etc/environment; \
|
||||||
|
docker-entrypoint.sh mysqld
|
||||||
28
config/mysql/backup-script
Normal file
28
config/mysql/backup-script
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
FREQUENTY=`basename "$0"`
|
||||||
|
TIMESTAMP=$(date +"%Y-%m-%d")
|
||||||
|
|
||||||
|
case $FREQUENTY in
|
||||||
|
|
||||||
|
daily)
|
||||||
|
DAYS=6
|
||||||
|
;;
|
||||||
|
|
||||||
|
weekly)
|
||||||
|
DAYS=30
|
||||||
|
find /backups -type f -name $TIMESTAMP-daily.sql.gz -delete
|
||||||
|
;;
|
||||||
|
|
||||||
|
monthly)
|
||||||
|
DAYS=122
|
||||||
|
find /backups -type f -name $TIMESTAMP-weekly.sql.gz -delete
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
mysqldump -u ${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} | gzip > /backups/$TIMESTAMP-$FREQUENTY.sql.gz
|
||||||
|
|
||||||
|
# Remove old backups
|
||||||
|
find /backups -mtime +${DAYS} -type f -name *-$FREQUENTY.sql.gz -delete
|
||||||
|
|
||||||
|
exit 0;
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
session.auto_start = Off
|
|
||||||
short_open_tag = Off
|
|
||||||
|
|
||||||
error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
|
|
||||||
|
|
||||||
opcache.enable_cli=1
|
|
||||||
opcache.fast_shutdown=1
|
|
||||||
opcache.memory_consumption=128
|
|
||||||
opcache.interned_strings_buffer=8
|
|
||||||
opcache.max_accelerated_files=4000
|
|
||||||
opcache.revalidate_freq=60
|
|
||||||
# http://symfony.com/doc/current/performance.html
|
|
||||||
realpath_cache_size = 4096K
|
|
||||||
realpath_cache_ttl = 600
|
|
||||||
|
|
||||||
memory_limit = 2G
|
|
||||||
post_max_size = 6M
|
|
||||||
upload_max_filesize = 5M
|
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
session.auto_start = Off
|
; How often (in seconds) to check file timestamps for changes to the shared
|
||||||
short_open_tag = Off
|
; memory storage allocation. ("1" means validate once per second, but only
|
||||||
|
; once per request. "0" means always validate)
|
||||||
error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
|
;opcache.revalidate_freq=2
|
||||||
|
|
||||||
opcache.enable_cli=1
|
|
||||||
opcache.fast_shutdown=1
|
|
||||||
opcache.memory_consumption=128
|
|
||||||
opcache.interned_strings_buffer=8
|
|
||||||
opcache.max_accelerated_files=4000
|
|
||||||
opcache.revalidate_freq=60
|
opcache.revalidate_freq=60
|
||||||
|
|
||||||
# http://symfony.com/doc/current/performance.html
|
# http://symfony.com/doc/current/performance.html
|
||||||
realpath_cache_size = 4096K
|
; Duration of time, in seconds for which to cache realpath information for a given
|
||||||
|
; file or directory. For systems with rarely changing files, consider increasing this
|
||||||
|
; value.
|
||||||
|
; http://php.net/realpath-cache-ttl
|
||||||
|
;realpath_cache_ttl = 120
|
||||||
realpath_cache_ttl = 600
|
realpath_cache_ttl = 600
|
||||||
|
|
||||||
post_max_size = 6M
|
; Maximum allowed size for uploaded files.
|
||||||
upload_max_filesize = 5M
|
; http://php.net/upload-max-filesize
|
||||||
|
upload_max_filesize = 8M
|
||||||
8
config/shutdown.sh
Normal file
8
config/shutdown.sh
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
printf "READY\n";
|
||||||
|
|
||||||
|
while read line; do
|
||||||
|
echo "Processing Event: $line" >&2;
|
||||||
|
kill -SIGQUIT $PPID
|
||||||
|
done < /dev/stdin
|
||||||
47
config/supervisor/supervisord.conf
Normal file
47
config/supervisor/supervisord.conf
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
user=invoiceninja
|
||||||
|
pidfile=/var/run/supervisord/supervisord.pid
|
||||||
|
logfile=/dev/null ; nodaemon will cause logs to go to stdout
|
||||||
|
logfile_maxbytes=0
|
||||||
|
loglevel=error
|
||||||
|
|
||||||
|
[program:php-fpm]
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
redirect_stderr=true
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
command=php-fpm
|
||||||
|
|
||||||
|
[program:scheduler]
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
redirect_stderr=true
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
command=php artisan schedule:work
|
||||||
|
|
||||||
|
[program:queue-worker]
|
||||||
|
process_name=%(program_name)s_%(process_num)02d
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
redirect_stderr=true
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
numprocs=2
|
||||||
|
command=php artisan queue:work --sleep=3 --tries=3 --memory=256
|
||||||
|
|
||||||
|
[eventlistener:shutdown]
|
||||||
|
command=/shutdown.sh
|
||||||
|
events=PROCESS_STATE_STOPPED, PROCESS_STATE_EXITED, PROCESS_STATE_FATAL
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
@@ -9,7 +9,6 @@ services:
|
|||||||
# Vhost configuration
|
# Vhost configuration
|
||||||
#- ./config/caddy/Caddyfile:/etc/caddy/Caddyfiledocker-com
|
#- ./config/caddy/Caddyfile:/etc/caddy/Caddyfiledocker-com
|
||||||
- ./config/nginx/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf:ro
|
- ./config/nginx/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf:ro
|
||||||
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
|
|
||||||
- ./docker/app/public:/var/www/app/public:rw,delegated
|
- ./docker/app/public:/var/www/app/public:rw,delegated
|
||||||
- ./docker/app/storage:/var/www/app/storage:rw,delegated
|
- ./docker/app/storage:/var/www/app/storage:rw,delegated
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -28,11 +27,9 @@ services:
|
|||||||
image: invoiceninja/invoiceninja:5
|
image: invoiceninja/invoiceninja:5
|
||||||
env_file: env
|
env_file: env
|
||||||
restart: always
|
restart: always
|
||||||
cap_add:
|
|
||||||
- SYS_ADMIN
|
|
||||||
volumes:
|
volumes:
|
||||||
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
|
|
||||||
- ./config/hosts:/etc/hosts:ro
|
- ./config/hosts:/etc/hosts:ro
|
||||||
|
- ./config/shutdown.sh:/usr/local/bin/shutdown.sh
|
||||||
- ./docker/app/public:/var/www/app/public:rw,delegated
|
- ./docker/app/public:/var/www/app/public:rw,delegated
|
||||||
- ./docker/app/storage:/var/www/app/storage:rw,delegated
|
- ./docker/app/storage:/var/www/app/storage:rw,delegated
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -44,6 +41,9 @@ services:
|
|||||||
|
|
||||||
db:
|
db:
|
||||||
image: mysql:5
|
image: mysql:5
|
||||||
|
# For auto DB backups comment out image and use the build block below
|
||||||
|
# build:
|
||||||
|
# context: ./config/mysql
|
||||||
ports:
|
ports:
|
||||||
- "3305:3306"
|
- "3305:3306"
|
||||||
restart: always
|
restart: always
|
||||||
@@ -53,26 +53,13 @@ services:
|
|||||||
- MYSQL_PASSWORD=ninja
|
- MYSQL_PASSWORD=ninja
|
||||||
- MYSQL_DATABASE=ninja
|
- MYSQL_DATABASE=ninja
|
||||||
volumes:
|
volumes:
|
||||||
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
|
|
||||||
- ./docker/mysql/data:/var/lib/mysql:rw,delegated
|
- ./docker/mysql/data:/var/lib/mysql:rw,delegated
|
||||||
networks:
|
|
||||||
- invoiceninja
|
|
||||||
extra_hosts:
|
|
||||||
- "in5.localhost:192.168.0.124 " #host and ip
|
|
||||||
|
|
||||||
# THIS IS ONLY A VALID CONFIGURATION FOR IN 5. DO NOT USE FOR IN 4.
|
# remove comments for next 4 lines if you want auto sql backups
|
||||||
cron:
|
#- ./docker/mysql/bak:/backups:rw
|
||||||
image: invoiceninja/invoiceninja:5
|
#- ./config/mysql/backup-script:/etc/cron.daily/daily:ro
|
||||||
env_file: env
|
#- ./config/mysql/backup-script:/etc/cron.weekly/weekly:ro
|
||||||
volumes:
|
#- ./config/mysql/backup-script:/etc/cron.monthly/monthly:ro
|
||||||
- ./config/cron.sh:/usr/local/bin/cron.sh
|
|
||||||
- ./config/hosts:/etc/hosts:ro
|
|
||||||
- ./docker/app/public:/var/www/app/public:rw,delegated
|
|
||||||
- ./docker/app/storage:/var/www/app/storage:rw,delegated
|
|
||||||
command:
|
|
||||||
- cron.sh
|
|
||||||
depends_on:
|
|
||||||
- app
|
|
||||||
networks:
|
networks:
|
||||||
- invoiceninja
|
- invoiceninja
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
|
|||||||
6
env
6
env
@@ -6,6 +6,10 @@ DB_HOST1=db
|
|||||||
DB_USERNAME1=ninja
|
DB_USERNAME1=ninja
|
||||||
DB_PASSWORD1=ninja
|
DB_PASSWORD1=ninja
|
||||||
DB_DATABASE1=ninja
|
DB_DATABASE1=ninja
|
||||||
|
|
||||||
|
#this is a system variable please do not remove
|
||||||
|
IS_DOCKER=true
|
||||||
|
|
||||||
PHANTOMJS_PDF_GENERATION=false
|
PHANTOMJS_PDF_GENERATION=false
|
||||||
|
|
||||||
#V4 env vars
|
#V4 env vars
|
||||||
@@ -14,4 +18,4 @@ DB_HOST=db
|
|||||||
DB_DATABASE=ninja
|
DB_DATABASE=ninja
|
||||||
DB_USERNAME=ninja
|
DB_USERNAME=ninja
|
||||||
DB_PASSWORD=ninja
|
DB_PASSWORD=ninja
|
||||||
APP_CIPHER=AES-256-CBC
|
APP_CIPHER=AES-256-CBC
|
||||||
|
|||||||
13
examples/v5/supervisor/Dockerfile
Normal file
13
examples/v5/supervisor/Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
FROM invoiceninja/invoiceninja:5
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
RUN apk add --no-cache supervisor \
|
||||||
|
&& mkdir /var/log/supervisord /var/run/supervisord \
|
||||||
|
&& chown $INVOICENINJA_USER:www-data /var/log/supervisord /var/run/supervisord
|
||||||
|
|
||||||
|
COPY supervisord.conf /
|
||||||
|
|
||||||
|
USER $INVOICENINJA_USER
|
||||||
|
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
|
||||||
29
examples/v5/supervisor/supervisord.conf
Normal file
29
examples/v5/supervisor/supervisord.conf
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
user=invoiceninja
|
||||||
|
pidfile=/var/run/supervisord/supervisord.pid
|
||||||
|
logfile=/dev/null ; nodaemon will cause logs to go to stdout
|
||||||
|
logfile_maxbytes=0
|
||||||
|
loglevel=error
|
||||||
|
|
||||||
|
[program:php-fpm]
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
command=php-fpm
|
||||||
|
|
||||||
|
[program:scheduler]
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
command=php artisan schedule:work
|
||||||
|
|
||||||
|
[program:queue-worker]
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
numprocs=2
|
||||||
|
command=php artisan queue:work --sleep=3 --tries=1 --memory=1024 --timeout=3600 --daemon
|
||||||
Reference in New Issue
Block a user