mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 06:24:44 +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 \
|
||||
libpng-dev libjpeg-turbo-dev freetype-dev libzip-dev icu-dev \
|
||||
zip unzip curl \
|
||||
&& docker-php-ext-install \
|
||||
bcmath gd intl zip opcache pcntl posix pdo_mysql
|
||||
&& docker-php-ext-install bcmath gd intl zip opcache pcntl posix pdo_mysql
|
||||
|
||||
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
|
||||
|
||||
# Install required libraries and PHP extensions
|
||||
# Install additional required libraries
|
||||
RUN apk update && apk add --no-cache \
|
||||
libpng-dev libjpeg-turbo-dev freetype-dev libzip-dev icu-dev \
|
||||
zip unzip curl caddy ca-certificates supervisor \
|
||||
&& docker-php-ext-install bcmath gd intl zip opcache pcntl posix pdo_mysql
|
||||
zip unzip curl caddy ca-certificates supervisor
|
||||
|
||||
# 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 --from=yarn /build .
|
||||
|
Loading…
x
Reference in New Issue
Block a user