fix: Dockerfile.fast now self-contained (no base image dependency)
Some checks failed
ci/woodpecker/push/ci Pipeline failed

Inline PHP extension installation so it works without pre-pushing
the base image to the registry. Still faster than multi-stage
Dockerfile because composer+frontend are built in parallel CI steps.

Future optimization: Run ./docker/base/build-and-push.sh from a
server with registry access, then switch FROM back to hub-base:latest
This commit is contained in:
kelly
2025-12-15 19:42:47 -07:00
parent 486c16d0fa
commit c0c3c2a754

View File

@@ -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