add old docker folder

This commit is contained in:
2026-01-27 14:10:19 +01:00
parent 3de54dc63f
commit a14ca16f18
7 changed files with 169 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
FROM alpine:latest
RUN apk add --no-cache mariadb-client bash dcron
RUN mkdir -p /backups
RUN mkdir -p /etc/periodic/15min
COPY backup/backup_db.sh /etc/periodic/15min/backup_db
COPY backup/entrypoint2.sh /entrypoint.sh
RUN chmod +x /etc/periodic/15min/backup_db
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
DB_USER="root"
DB_PASS="root"
DB_NAME="laravel"
BACKUP_DIR="/backups"
mkdir -p "$BACKUP_DIR"
DAY=$(date +%d)
FILE="$BACKUP_DIR/$DAY.sql"
mysqldump -h mariadb -u "$DB_USER" -p"$DB_PASS" "$DB_NAME" > "$FILE"
echo "[$(date)] Backup $DB_NAME sauvegardé dans $FILE" >> "$BACKUP_DIR/backup.log"
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
crond -f -l 2