From 1bee5b4b9a3f1a9cf8929eea74a0197e3b73dd0c Mon Sep 17 00:00:00 2001
From: Julian PEREZ-RAMIREZ <julian.perez-ramirez@imt-atlantique.net>
Date: Sun, 23 Feb 2025 12:35:28 +0100
Subject: [PATCH] editing dockerfile to install composer dependencies

---
 symfony.dockerfile | 30 ++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/symfony.dockerfile b/symfony.dockerfile
index 72f18ab..00cf9f1 100644
--- a/symfony.dockerfile
+++ b/symfony.dockerfile
@@ -1,13 +1,27 @@
-FROM bitnami/symfony:latest
+FROM php:8.2-fpm
 
-WORKDIR /app
+WORKDIR /var/www
 
-COPY . /app
+# Install required system dependencies
+RUN apt-get update && apt-get install -y \
+    unzip \
+    git \
+    libpq-dev \
+    libzip-dev \
+    && docker-php-ext-install pdo pdo_mysql zip
 
-# Ensure dependencies are installed
-RUN composer install --no-interaction --prefer-dist --optimize-autoloader
+# Install Composer
+RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
+    php composer-setup.php --install-dir=/usr/local/bin --filename=composer && \
+    php -r "unlink('composer-setup.php');"
 
-# Install Doctrine ORM explicitly
-RUN composer require symfony/orm-pack --no-scripts --no-interactio
+# Copy existing application files to container
+COPY ./web_app /var/www
 
-EXPOSE 8000
+# Install Symfony dependencies
+RUN composer install --no-scripts --no-autoloader && composer dump-autoload
+
+# Set permissions
+RUN chown -R www-data:www-data /var/www
+
+CMD ["php-fpm"]
\ No newline at end of file
-- 
GitLab