Merge consecutive RUN instructions in Dockerfiles into single layer
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,21 +11,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
libfreetype-dev \
|
libfreetype-dev \
|
||||||
libmagickwand-dev \
|
libmagickwand-dev \
|
||||||
unzip \
|
unzip \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||||
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|
||||||
&& docker-php-ext-install \
|
&& docker-php-ext-install \
|
||||||
pdo_mysql \
|
pdo_mysql \
|
||||||
pdo_pgsql \
|
pdo_pgsql \
|
||||||
pdo_sqlite \
|
pdo_sqlite \
|
||||||
zip \
|
zip \
|
||||||
intl \
|
intl \
|
||||||
gd
|
gd \
|
||||||
|
&& pecl install redis imagick \
|
||||||
RUN pecl install redis imagick \
|
&& docker-php-ext-enable redis imagick \
|
||||||
&& docker-php-ext-enable redis imagick
|
&& groupadd -g 1000 appuser && useradd -u 1000 -g appuser -m appuser
|
||||||
|
|
||||||
RUN groupadd -g 1000 appuser && useradd -u 1000 -g appuser -m appuser
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
libfreetype-dev \
|
libfreetype-dev \
|
||||||
libmagickwand-dev \
|
libmagickwand-dev \
|
||||||
unzip \
|
unzip \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||||
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|
||||||
&& docker-php-ext-install \
|
&& docker-php-ext-install \
|
||||||
pdo_mysql \
|
pdo_mysql \
|
||||||
pdo_pgsql \
|
pdo_pgsql \
|
||||||
@@ -21,16 +20,14 @@ RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|||||||
zip \
|
zip \
|
||||||
intl \
|
intl \
|
||||||
gd \
|
gd \
|
||||||
opcache
|
opcache \
|
||||||
|
&& pecl install redis imagick \
|
||||||
RUN pecl install redis imagick \
|
&& docker-php-ext-enable redis imagick \
|
||||||
&& docker-php-ext-enable redis imagick
|
&& groupadd -g 1000 appuser && useradd -u 1000 -g appuser -m appuser
|
||||||
|
|
||||||
COPY php.ini /usr/local/etc/php/conf.d/app.ini
|
COPY php.ini /usr/local/etc/php/conf.d/app.ini
|
||||||
COPY opcache.ini /usr/local/etc/php/conf.d/opcache.ini
|
COPY opcache.ini /usr/local/etc/php/conf.d/opcache.ini
|
||||||
|
|
||||||
RUN groupadd -g 1000 appuser && useradd -u 1000 -g appuser -m appuser
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
USER appuser
|
USER appuser
|
||||||
|
|||||||
Reference in New Issue
Block a user