diff --git a/Dockerfile.fast b/Dockerfile.fast index 1afcd9c5..11368db4 100644 --- a/Dockerfile.fast +++ b/Dockerfile.fast @@ -1,10 +1,61 @@ # ============================================ # Fast Production Dockerfile -# Uses pre-built base image - build time ~2-3 min vs 15-20 min +# Single-stage build using CI pre-built assets +# Saves time by skipping multi-stage node/composer builders +# ============================================ +# +# This Dockerfile expects: +# - vendor/ already populated (from CI composer-install step) +# - public/build/ already populated (from CI build-frontend step) +# +# Build time: ~5-7 min (vs 15-20 min with multi-stage Dockerfile) # ============================================ -# Use pre-built base with all PHP extensions -FROM 10.100.9.70:5000/cannabrands/hub-base:latest +FROM 10.100.9.70:5000/library/php:8.3-fpm-alpine + +LABEL maintainer="CannaBrands Team" + +# Install system dependencies +RUN apk add --no-cache \ + nginx \ + supervisor \ + postgresql-dev \ + libpng-dev \ + libjpeg-turbo-dev \ + freetype-dev \ + libzip-dev \ + icu-dev \ + icu-data-full \ + zip \ + unzip \ + git \ + curl \ + bash + +# Install build dependencies for PHP extensions +RUN apk add --no-cache --virtual .build-deps \ + autoconf \ + g++ \ + make + +# Install PHP extensions +RUN docker-php-ext-configure gd --with-freetype --with-jpeg \ + && docker-php-ext-install -j$(nproc) \ + pdo_pgsql \ + pgsql \ + gd \ + zip \ + intl \ + pcntl \ + bcmath \ + opcache + +# Install Redis extension +RUN pecl install redis \ + && docker-php-ext-enable redis \ + && apk del .build-deps + +WORKDIR /var/www/html ARG GIT_COMMIT_SHA=unknown ARG APP_VERSION=dev