35 lines
825 B
Docker
35 lines
825 B
Docker
FROM arm64v8/php:8.1-apache
|
|
|
|
# Installation des dépendances PHP nécessaires
|
|
RUN apt-get update && apt-get install -y \
|
|
libfreetype6-dev \
|
|
libjpeg62-turbo-dev \
|
|
libpng-dev \
|
|
git \
|
|
unzip \
|
|
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|
&& docker-php-ext-install -j$(nproc) gd
|
|
|
|
# Activer le module rewrite pour Apache
|
|
RUN a2enmod rewrite
|
|
|
|
# Installer Composer
|
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|
|
|
# Définir le répertoire de travail
|
|
WORKDIR /var/www/html
|
|
|
|
# Copier le code source
|
|
COPY . /var/www/html/
|
|
|
|
# Installer les dépendances via Composer
|
|
RUN composer install --no-interaction --optimize-autoloader
|
|
|
|
# Ajuster les permissions
|
|
RUN chown -R www-data:www-data /var/www/html
|
|
|
|
# Exposer le port 80
|
|
EXPOSE 80
|
|
|
|
# Démarrer Apache
|
|
CMD ["apache2-foreground"] |