mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 15:44:45 +02:00
feat(docker): copy PHP extensions from builder stage to speedup the build
- Reuse compiled PHP extensions from composer stage instead of building them twice
This commit is contained in:
parent
6b77e69e43
commit
43d0b78742
12
Dockerfile
12
Dockerfile
@ -14,8 +14,7 @@ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
|
|||||||
RUN apk update && apk add --no-cache \
|
RUN apk update && apk add --no-cache \
|
||||||
libpng-dev libjpeg-turbo-dev freetype-dev libzip-dev icu-dev \
|
libpng-dev libjpeg-turbo-dev freetype-dev libzip-dev icu-dev \
|
||||||
zip unzip curl \
|
zip unzip curl \
|
||||||
&& docker-php-ext-install \
|
&& docker-php-ext-install bcmath gd intl zip opcache pcntl posix pdo_mysql
|
||||||
bcmath gd intl zip opcache pcntl posix pdo_mysql
|
|
||||||
|
|
||||||
RUN composer install --no-dev --optimize-autoloader
|
RUN composer install --no-dev --optimize-autoloader
|
||||||
|
|
||||||
@ -41,11 +40,14 @@ WORKDIR /var/www/html
|
|||||||
|
|
||||||
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
|
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
|
||||||
|
|
||||||
# Install required libraries and PHP extensions
|
# Install additional required libraries
|
||||||
RUN apk update && apk add --no-cache \
|
RUN apk update && apk add --no-cache \
|
||||||
libpng-dev libjpeg-turbo-dev freetype-dev libzip-dev icu-dev \
|
libpng-dev libjpeg-turbo-dev freetype-dev libzip-dev icu-dev \
|
||||||
zip unzip curl caddy ca-certificates supervisor \
|
zip unzip curl caddy ca-certificates supervisor
|
||||||
&& docker-php-ext-install bcmath gd intl zip opcache pcntl posix pdo_mysql
|
|
||||||
|
# Copy PHP extensions and configuration from Composer stage
|
||||||
|
COPY --from=composer /usr/local/lib/php/extensions/ /usr/local/lib/php/extensions/
|
||||||
|
COPY --from=composer /usr/local/etc/php/conf.d/ /usr/local/etc/php/conf.d/
|
||||||
|
|
||||||
COPY Caddyfile /etc/caddy/Caddyfile
|
COPY Caddyfile /etc/caddy/Caddyfile
|
||||||
COPY --from=yarn /build .
|
COPY --from=yarn /build .
|
||||||
|
Loading…
x
Reference in New Issue
Block a user