- 134-tool registry with programmatic SEO (unique titles/H1/descriptions, JSON-LD graphs, sitemap index, canonical 301 enforcement via required filter) - DB-backed job queue (SKIP LOCKED) with drivers: Ffmpeg, Images (GD), Pdf (qpdf/gs/poppler), Youtube (thumbnails), Qr (server-side PNG) - Security: SSRF guard, MIME validation, rate limits, API-key auth, bcrypt admin login, security headers - Admin panel: dashboard, tools/categories/guides CRUD, SEO audit, analytics, job inspector with retry, system health, feature flags - Docker deployment (nginx + web/api FPM pools + scalable workers), PHPUnit suite (19 tests / 1139 assertions), PWA manifest + service worker
45 lines
2.0 KiB
Docker
45 lines
2.0 KiB
Docker
# ---------------------------------------------------------------------------
|
|
# Toolvana web/api image: PHP-FPM 8.2 with all media processing binaries.
|
|
# The same image serves the web tier and runs workers/scheduler — services
|
|
# differ only by command, keeping builds small and versions identical.
|
|
# ---------------------------------------------------------------------------
|
|
|
|
FROM php:8.2-fpm-alpine AS base
|
|
|
|
RUN apk add --no-cache bash icu-libs libzip oniguruma libpng jpegoptim
|
|
|
|
# --- PHP extensions required by CodeIgniter 4 + app ------------------------
|
|
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS icu-dev libzip-dev oniguruma-dev libpng-dev \
|
|
&& docker-php-ext-install intl mbstring zip pdo_mysql mysqli opcache pcntl exif \
|
|
&& pecl install redis \
|
|
&& docker-php-ext-enable redis \
|
|
&& apk del .build-deps
|
|
|
|
# --- Media processing stack -------------------------------------------------
|
|
RUN apk add --no-cache ffmpeg imagemagick poppler-utils qpdf ghostscript zip unzip curl \
|
|
&& wget -q https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O /usr/local/bin/yt-dlp \
|
|
&& chmod 755 /usr/local/bin/yt-dlp || true
|
|
|
|
# --- Composer deps -----------------------------------------------------------
|
|
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
|
WORKDIR /app
|
|
COPY composer.json composer.lock ./
|
|
RUN composer install --no-dev --no-scripts --no-autoloader --prefer-dist --no-interaction
|
|
|
|
COPY . .
|
|
RUN composer dump-autoload -o \
|
|
&& chown -R www-data:www-data writable \
|
|
&& chmod -R ug+rwX writable
|
|
|
|
# --- PHP production defaults --------------------------------------------------
|
|
RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini \
|
|
&& { echo "opcache.enable=1"; \
|
|
echo "opcache.validate_timestamps=0"; \
|
|
echo "opcache.memory_consumption=192"; \
|
|
echo "realpath_cache_size=4096K"; \
|
|
echo "memory_limit=512M"; } > /usr/local/etc/php/conf.d/toolvana.ini
|
|
|
|
EXPOSE 9000
|
|
|
|
CMD ["php-fpm"]
|