mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2026-01-01 20:17:26 +01:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f175fa4fb0 | ||
|
|
0d93596cde | ||
|
|
10aaf3fb6e | ||
|
|
8117d0c5bd | ||
|
|
fef92891cb | ||
|
|
7f415803fb | ||
|
|
1caa8c7e70 | ||
|
|
e35653fe59 | ||
|
|
4d7cc8e464 |
@@ -11,6 +11,10 @@
|
||||
:hammer: Fully production-ready through docker-compose
|
||||
: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
|
||||
|
||||
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.
|
||||
|
||||
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;
|
||||
@@ -41,6 +41,9 @@ services:
|
||||
|
||||
db:
|
||||
image: mysql:5
|
||||
# For auto DB backups comment out image and use the build block below
|
||||
# build:
|
||||
# context: ./config/mysql
|
||||
ports:
|
||||
- "3305:3306"
|
||||
restart: always
|
||||
@@ -51,6 +54,12 @@ services:
|
||||
- MYSQL_DATABASE=ninja
|
||||
volumes:
|
||||
- ./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:
|
||||
- invoiceninja
|
||||
extra_hosts:
|
||||
|
||||
Reference in New Issue
Block a user