mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2026-01-06 22:47:26 +01:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f175fa4fb0 | ||
|
|
0d93596cde | ||
|
|
10aaf3fb6e | ||
|
|
8117d0c5bd | ||
|
|
fef92891cb | ||
|
|
7f415803fb | ||
|
|
1caa8c7e70 | ||
|
|
e35653fe59 | ||
|
|
4d7cc8e464 | ||
|
|
c6e122b81f | ||
|
|
421a1f10e6 | ||
|
|
84db77cde8 | ||
|
|
e8706de11c |
@@ -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.
|
||||||
|
|||||||
@@ -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;
|
||||||
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
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
[supervisord]
|
[supervisord]
|
||||||
process_name=%(program_name)s_%(process_num)02d
|
|
||||||
nodaemon=true
|
nodaemon=true
|
||||||
user=invoiceninja
|
user=invoiceninja
|
||||||
pidfile=/var/run/supervisord/supervisord.pid
|
pidfile=/var/run/supervisord/supervisord.pid
|
||||||
@@ -8,7 +7,6 @@ logfile_maxbytes=0
|
|||||||
loglevel=error
|
loglevel=error
|
||||||
|
|
||||||
[program:php-fpm]
|
[program:php-fpm]
|
||||||
process_name=%(program_name)s_%(process_num)02d
|
|
||||||
autostart=true
|
autostart=true
|
||||||
autorestart=true
|
autorestart=true
|
||||||
redirect_stderr=true
|
redirect_stderr=true
|
||||||
@@ -19,7 +17,6 @@ stderr_logfile_maxbytes=0
|
|||||||
command=php-fpm
|
command=php-fpm
|
||||||
|
|
||||||
[program:scheduler]
|
[program:scheduler]
|
||||||
process_name=%(program_name)s_%(process_num)02d
|
|
||||||
autostart=true
|
autostart=true
|
||||||
autorestart=true
|
autorestart=true
|
||||||
redirect_stderr=true
|
redirect_stderr=true
|
||||||
@@ -39,4 +36,12 @@ stdout_logfile_maxbytes=0
|
|||||||
stderr_logfile=/dev/stderr
|
stderr_logfile=/dev/stderr
|
||||||
stderr_logfile_maxbytes=0
|
stderr_logfile_maxbytes=0
|
||||||
numprocs=2
|
numprocs=2
|
||||||
command=php artisan queue:work --sleep=3 --tries=1 --memory=256 --timeout=3600 --daemon
|
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:
|
||||||
@@ -29,8 +28,8 @@ services:
|
|||||||
env_file: env
|
env_file: env
|
||||||
restart: always
|
restart: always
|
||||||
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:
|
||||||
@@ -42,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
|
||||||
@@ -51,31 +53,18 @@ 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
|
||||||
|
|
||||||
|
# remove comments for next 4 lines if you want auto sql backups
|
||||||
|
#- ./docker/mysql/bak:/backups:rw
|
||||||
|
#- ./config/mysql/backup-script:/etc/cron.daily/daily:ro
|
||||||
|
#- ./config/mysql/backup-script:/etc/cron.weekly/weekly:ro
|
||||||
|
#- ./config/mysql/backup-script:/etc/cron.monthly/monthly:ro
|
||||||
networks:
|
networks:
|
||||||
- invoiceninja
|
- invoiceninja
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- "in5.localhost:192.168.0.124 " #host and ip
|
- "in5.localhost:192.168.0.124 " #host and ip
|
||||||
|
|
||||||
# THIS IS ONLY A VALID CONFIGURATION FOR IN 5. DO NOT USE FOR IN 4.
|
|
||||||
# cron:
|
|
||||||
# image: invoiceninja/invoiceninja:5
|
|
||||||
# env_file: env
|
|
||||||
# volumes:
|
|
||||||
# - ./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:
|
|
||||||
# - invoiceninja
|
|
||||||
# extra_hosts:
|
|
||||||
# - "in5.localhost:192.168.0.124 " #host and ip
|
|
||||||
|
|
||||||
# THIS IS ONLY A VALID CONFIGURATION FOR IN 4. DO NOT USE FOR IN 5.
|
# THIS IS ONLY A VALID CONFIGURATION FOR IN 4. DO NOT USE FOR IN 5.
|
||||||
# cron:
|
# cron:
|
||||||
# image: invoiceninja/invoiceninja:alpine-4
|
# image: invoiceninja/invoiceninja:alpine-4
|
||||||
|
|||||||
4
env
4
env
@@ -10,10 +10,12 @@ DB_DATABASE1=ninja
|
|||||||
#this is a system variable please do not remove
|
#this is a system variable please do not remove
|
||||||
IS_DOCKER=true
|
IS_DOCKER=true
|
||||||
|
|
||||||
|
PHANTOMJS_PDF_GENERATION=false
|
||||||
|
|
||||||
#V4 env vars
|
#V4 env vars
|
||||||
DB_STRICT=false
|
DB_STRICT=false
|
||||||
DB_HOST=db
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user