add old docker folder
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
php:
|
||||
build:
|
||||
context: docker
|
||||
dockerfile: docker/php/Dockerfile
|
||||
container_name: app-php
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
volumes:
|
||||
- ../:/var/www/app
|
||||
environment:
|
||||
- GIT_TOKEN=${GIT_TOKEN}
|
||||
- GIT_REPO=${GIT_REPO}
|
||||
depends_on:
|
||||
- mariadb
|
||||
|
||||
|
||||
nginx:
|
||||
image: nginx
|
||||
container_name: app-nginx
|
||||
volumes:
|
||||
- ../:/var/www/app
|
||||
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||
ports:
|
||||
- "80:80"
|
||||
depends_on:
|
||||
- php
|
||||
|
||||
mariadb:
|
||||
image: mariadb:latest
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
MYSQL_DATABASE: laravel
|
||||
ports:
|
||||
- "3306:3306"
|
||||
volumes:
|
||||
- dbdata:/var/lib/mysql
|
||||
|
||||
|
||||
typesense:
|
||||
image: typesense/typesense:29.0
|
||||
restart: on-failure
|
||||
ports:
|
||||
- "8108:8108"
|
||||
volumes:
|
||||
- typesense-data:/data
|
||||
command: '--data-dir /data --api-key=xyz --enable-cors'
|
||||
|
||||
backup:
|
||||
build:
|
||||
context: docker
|
||||
dockerfile: docker/backup/Dockerfile
|
||||
container_name: app-backup
|
||||
volumes:
|
||||
- ./backups:/backups
|
||||
depends_on:
|
||||
- mariadb
|
||||
restart: unless-stopped
|
||||
|
||||
reverb:
|
||||
build:
|
||||
context: docker
|
||||
dockerfile: docker/php/Dockerfile
|
||||
container_name: app-reverb
|
||||
entrypoint: /usr/local/bin/entrypoint.sh
|
||||
command: php artisan reverb:start --host=0.0.0.0 --port=8080
|
||||
volumes:
|
||||
- ../:/var/www/app
|
||||
ports:
|
||||
- "8080:8080"
|
||||
depends_on:
|
||||
- php
|
||||
- mariadb
|
||||
|
||||
|
||||
volumes:
|
||||
dbdata:
|
||||
typesense-data:
|
||||
|
||||
networks:
|
||||
default:
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 192.168.200.0/24
|
||||
@@ -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"]
|
||||
Executable
+15
@@ -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"
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
crond -f -l 2
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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"]
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
APP_DIR=/var/www/app
|
||||
cd $APP_DIR
|
||||
|
||||
git config --global --add safe.directory $APP_DIR || true
|
||||
|
||||
if [ ! -d "vendor" ]; then
|
||||
composer install --no-interaction --prefer-dist
|
||||
fi
|
||||
|
||||
mkdir -p storage bootstrap/cache
|
||||
chown -R www-data:www-data storage bootstrap/cache
|
||||
chmod -R 775 storage bootstrap/cache
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user