11FROM php:8.3.11-apache
22
33WORKDIR /var/www
4- ENV DEBIAN_FRONTEND noninteractive
5- ENV WWW_ROOT="/var/www"
4+ ENV DEBIAN_FRONTEND=noninteractive
65
7- # Install dependencies
8- RUN apt-get clean && apt-get update -y --allow-insecure-repositories
9- RUN apt-get install -y \
6+ ARG WWW_ROOT="/var/www"
7+ ENV WWW_ROOT=$WWW_ROOT
8+
9+ # Updating packages and installing dependencies in a single layer with cache cleaning
10+ RUN apt-get update -y --allow-insecure-repositories && \
11+ apt-get install -y --no-install-recommends \
1012 git \
1113 libfreetype6-dev \
1214 libicu-dev \
@@ -17,11 +19,12 @@ RUN apt-get install -y \
1719 rsync \
1820 unzip \
1921 sudo \
20- zip
22+ zip && \
23+ apt-get clean && rm -rf /var/lib/apt/lists/*
2124
22- # Install PHP extensions
23- RUN docker-php-ext-configure gd --with-freetype --with-jpeg
24- RUN docker-php-ext-install -j$(nproc) \
25+ # Installing PHP extensions with cache cleaning
26+ RUN docker-php-ext-configure gd --with-freetype --with-jpeg && \
27+ docker-php-ext-install -j$(nproc) \
2528 gd \
2629 intl \
2730 mbstring \
@@ -31,18 +34,16 @@ RUN docker-php-ext-install -j$(nproc) \
3134
3235RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
3336
34- # Install Symfony CLI
35- RUN curl -1sLf 'https://dl.cloudsmith.io/public/symfony/stable/setup.deb.sh' | sudo -E bash
36- RUN apt-get install symfony-cli
37- RUN symfony server:ca:install
37+ # Installation of Symfony CLI with cache cleaning
38+ RUN curl -1sLf 'https://dl.cloudsmith.io/public/symfony/stable/setup.deb.sh' | sudo -E bash && \
39+ apt-get install -y symfony-cli && \
40+ symfony server:ca:install && \
41+ apt-get clean && rm -rf /var/lib/apt/lists/*
3842
3943# Configure Apache
4044ADD docker/apache/entrypoint.sh /entrypoint.sh
41- RUN chmod a+x /entrypoint.sh
42-
43- RUN a2enmod rewrite
44- RUN a2enmod remoteip
45- RUN a2enmod ssl
45+ RUN chmod a+x /entrypoint.sh && \
46+ a2enmod rewrite remoteip ssl
4647
4748CMD ["/entrypoint.sh" ]
4849
0 commit comments