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