From 124fd240aec5c064dfc679bca945c133c6c1c9e6 Mon Sep 17 00:00:00 2001 From: Sam DEPARDIEU Date: Wed, 25 Mar 2026 22:38:25 +0100 Subject: [PATCH] =?UTF-8?q?ajout=20code=20de=20d=C3=A9ploiement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DOCKERFILE | 27 +++++++++++++++++++++++++++ docker-compose.yml | 16 ++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 DOCKERFILE create mode 100644 docker-compose.yml diff --git a/DOCKERFILE b/DOCKERFILE new file mode 100644 index 0000000..dbf135c --- /dev/null +++ b/DOCKERFILE @@ -0,0 +1,27 @@ +FROM php:8.2-fpm + +# Installation des dépendances système +RUN apt-get update && apt-get install -y \ + git curl libpng-dev libonig-dev libxml2-dev zip unzip + +# Nettoyage du cache +RUN apt-get clean && rm -rf /var/lib/apt/lists/* + +# Installation des extensions PHP pour Laravel et MySQL +RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd + +# Récupération de Composer +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer + +# Dossier de travail +WORKDIR /var/www +COPY . . + +# Installation des dépendances Laravel +RUN composer install --no-interaction --optimize-autoloader --no-dev + +# Permissions pour le stockage Laravel +RUN chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache + +EXPOSE 9000 +CMD ["php-fpm"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..af75d14 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,16 @@ +version: '3' +services: + app: + build: + context: . + dockerfile: DOCKERFILE + container_name: laravel_app + restart: always + volumes: + - .:/var/www + networks: + - app-network + +networks: + app-network: + external: true # Pour qu'il puisse parler à ton MySQL et ton Proxy \ No newline at end of file