fix: stabilize PHP runtime builds

This commit is contained in:
reaper
2026-08-14 15:54:42 -05:00
parent 950b1208b3
commit 3361176b2e
+8 -5
View File
@@ -134,7 +134,7 @@ async function writePhpDockerfile(root: string, xdebug = false): Promise<void> {
FROM php:${'${PHP_VERSION}'}-fpm-alpine FROM php:${'${PHP_VERSION}'}-fpm-alpine
RUN apk add --no-cache icu-dev libzip-dev libpng-dev libjpeg-turbo-dev freetype-dev oniguruma-dev postgresql-dev \ RUN apk add --no-cache icu-dev libzip-dev libpng-dev libjpeg-turbo-dev freetype-dev oniguruma-dev postgresql-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) mysqli pdo_mysql pdo_pgsql intl zip gd mbstring opcache && docker-php-ext-install -j2 mysqli pdo_mysql pdo_pgsql intl zip gd mbstring
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
${xdebug ? 'RUN apk add --no-cache $PHPIZE_DEPS linux-headers && pecl install xdebug && docker-php-ext-enable xdebug' : ''} ${xdebug ? 'RUN apk add --no-cache $PHPIZE_DEPS linux-headers && pecl install xdebug && docker-php-ext-enable xdebug' : ''}
`) `)
@@ -582,6 +582,7 @@ export async function refreshRuntimeImages(): Promise<RuntimeImageRefreshResult>
for (const root of roots) { for (const root of roots) {
try { try {
await access(composePath(root)) await access(composePath(root))
const config = await readConfig(root)
// Pulls Node, nginx/Apache, MySQL/MariaDB/PostgreSQL, Adminer, Redis, // Pulls Node, nginx/Apache, MySQL/MariaDB/PostgreSQL, Adminer, Redis,
// Mailpit, and module-provided images. Running containers are not // Mailpit, and module-provided images. Running containers are not
// restarted, so an update cannot interrupt current work. // restarted, so an update cannot interrupt current work.
@@ -590,12 +591,14 @@ export async function refreshRuntimeImages(): Promise<RuntimeImageRefreshResult>
['compose', '-f', composePath(root), 'pull', '--ignore-buildable', '--policy', 'always'], ['compose', '-f', composePath(root), 'pull', '--ignore-buildable', '--policy', 'always'],
{ cwd: root, env: AURORA_ENV, maxBuffer: 32 * 1024 * 1024 } { cwd: root, env: AURORA_ENV, maxBuffer: 32 * 1024 * 1024 }
) )
// PHP is an Aurora-built image. --pull checks the selected php:<version> // PHP is built locally by Aurora. Refresh only its selected upstream
// base tag for a newer patch/security revision before using the cache. // base here; compiling in the background can collide with a user-started
// project build. Docker will consume the refreshed base on the next
// normal project build.
await execFileAsync( await execFileAsync(
'docker', 'docker',
['compose', '-f', composePath(root), 'build', '--pull', 'php'], ['pull', `php:${config.php}-fpm-alpine`],
{ cwd: root, env: AURORA_ENV, maxBuffer: 32 * 1024 * 1024 } { env: AURORA_ENV, maxBuffer: 32 * 1024 * 1024 }
) )
refreshedProjects += 1 refreshedProjects += 1
} catch (error) { } catch (error) {