- Enable PHP OPcache in Docker (256MB, dev-friendly settings) - Enable gzip compression in nginx + immutable caching for /build/ assets - Reduce fonts to latin-only subsets (from 28 files to ~6) - Lazy-load Vue pages via dynamic imports (D3 no longer loaded on login) - MetroMap chunk split out separately (62KB only when needed) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
58 lines
1.3 KiB
Docker
58 lines
1.3 KiB
Docker
FROM php:8.4-fpm
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
git \
|
|
curl \
|
|
libpng-dev \
|
|
libjpeg-dev \
|
|
libfreetype6-dev \
|
|
libzip-dev \
|
|
libicu-dev \
|
|
libpq-dev \
|
|
unzip \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Configure and install PHP extensions
|
|
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|
&& docker-php-ext-install -j$(nproc) \
|
|
pdo_pgsql \
|
|
pgsql \
|
|
pcntl \
|
|
bcmath \
|
|
gd \
|
|
zip \
|
|
intl
|
|
|
|
# Install Redis extension via PECL
|
|
RUN pecl install redis \
|
|
&& docker-php-ext-enable redis
|
|
|
|
# Enable OPcache
|
|
RUN docker-php-ext-enable opcache
|
|
COPY docker/php/opcache.ini /usr/local/etc/php/conf.d/opcache.ini
|
|
|
|
# Install Composer
|
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|
|
|
# Set working directory
|
|
WORKDIR /var/www/html
|
|
|
|
# Copy application files
|
|
COPY . .
|
|
|
|
# Install PHP dependencies (production-ready; skip dev deps when APP_ENV=production)
|
|
RUN composer install --no-interaction --prefer-dist --optimize-autoloader
|
|
|
|
# Set ownership to www-data
|
|
RUN chown -R www-data:www-data /var/www/html \
|
|
&& chmod -R 755 /var/www/html/storage \
|
|
&& chmod -R 755 /var/www/html/bootstrap/cache
|
|
|
|
# Switch to non-root user
|
|
USER www-data
|
|
|
|
EXPOSE 9000
|
|
|
|
CMD ["php-fpm"]
|