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
+20
View File
@@ -0,0 +1,20 @@
server {
listen 80;
server_name 127.0.0.1;
root /var/www/app/public;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SERVER_NAME 127.0.0.1;
fastcgi_param HTTPS off;
}
}
+15
View File
@@ -0,0 +1,15 @@
FROM php:8.4-fpm
RUN apt-get update && apt-get install -y \
git unzip libzip-dev libpng-dev libonig-dev \
&& docker-php-ext-install pdo_mysql zip pcntl
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
WORKDIR /var/www/app
ENTRYPOINT ["entrypoint.sh"]
CMD ["php-fpm"]