f9ce6f8221
package-lock.json was generated on Windows and only locks @esbuild/win32-x64, no linux-x64 entry. npm ci installs strictly from lockfile and fails with "package @esbuild/linux-x64 could not be found" on Linux build hosts. npm install resolves the correct platform binary even when absent from the lock. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
52 lines
1.2 KiB
Docker
52 lines
1.2 KiB
Docker
FROM node:20-alpine AS node-builder
|
|
WORKDIR /app
|
|
COPY package.json ./
|
|
RUN npm install --ignore-scripts
|
|
COPY . .
|
|
RUN npm run build:icons && npm run build
|
|
|
|
FROM composer:2.8 AS php-builder
|
|
WORKDIR /app
|
|
COPY composer*.json ./
|
|
RUN composer install \
|
|
--no-dev \
|
|
--no-interaction \
|
|
--no-plugins \
|
|
--no-scripts \
|
|
--prefer-dist
|
|
COPY . .
|
|
RUN composer dump-autoload --no-dev --optimize --no-scripts
|
|
|
|
FROM php:8.4-fpm-alpine AS runtime
|
|
WORKDIR /var/www/html
|
|
RUN apk add --no-cache \
|
|
libpng-dev \
|
|
libjpeg-turbo-dev \
|
|
freetype-dev \
|
|
zip \
|
|
libzip-dev \
|
|
unzip \
|
|
git \
|
|
oniguruma-dev \
|
|
$PHPIZE_DEPS \
|
|
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|
&& docker-php-ext-install pdo pdo_mysql mbstring zip exif pcntl gd opcache
|
|
|
|
COPY docker/opcache.ini /usr/local/etc/php/conf.d/opcache.ini
|
|
|
|
COPY --from=php-builder /app /var/www/html
|
|
COPY --from=node-builder /app/public/build /var/www/html/public/build
|
|
|
|
RUN rm -rf /var/www/html/docker
|
|
|
|
RUN ln -sf ../../storage/app/public /var/www/html/public/storage
|
|
|
|
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache \
|
|
&& chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache
|
|
|
|
USER www-data
|
|
|
|
EXPOSE 9000
|
|
CMD ["php-fpm"]
|
|
|