2026-03-24 20:13:16 +01:00
|
|
|
FROM php:8.5-fpm AS base
|
2026-02-04 23:31:53 +01:00
|
|
|
|
|
|
|
|
RUN apt-get update \
|
|
|
|
|
&& apt-get install -y --no-install-recommends \
|
|
|
|
|
git \
|
|
|
|
|
unzip \
|
add composer-unused, comprehensive docs, and project restructure
- Add icanhazstring/composer-unused as dev dependency for dependency hygiene checks
- Add German documentation (docs/) covering architecture, conventions, workflows, and developer checklists
- Add API layer (ApiAuth, ApiBootstrap, ApiResponse), audit, scheduler, custom fields, and SSO services
- Add Microsoft OIDC SSO, API token management, and user lifecycle features
- Add swagger-ui vendor integration and OpenAPI spec
- Add production Docker setup and bin/ scripts
- Update composer dependencies, config, templates, and frontend assets throughout
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 15:27:35 +01:00
|
|
|
libzip-dev \
|
2026-02-04 23:31:53 +01:00
|
|
|
libmemcached-dev \
|
|
|
|
|
zlib1g-dev \
|
|
|
|
|
libssl-dev \
|
|
|
|
|
libjpeg-dev \
|
|
|
|
|
libpng-dev \
|
|
|
|
|
libwebp-dev \
|
2026-03-25 07:26:04 +01:00
|
|
|
libldap2-dev \
|
2026-03-24 20:13:16 +01:00
|
|
|
&& pecl install memcached \
|
|
|
|
|
&& docker-php-ext-enable memcached \
|
2026-02-04 23:31:53 +01:00
|
|
|
&& docker-php-ext-configure gd --with-jpeg --with-webp \
|
2026-03-25 07:26:04 +01:00
|
|
|
&& docker-php-ext-install pdo_mysql mysqli gd zip ldap \
|
2026-02-04 23:31:53 +01:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
2026-03-24 20:13:16 +01:00
|
|
|
|
|
|
|
|
WORKDIR /var/www
|
|
|
|
|
|
|
|
|
|
# ── Development profile (default) ────────────────────────────────────
|
|
|
|
|
FROM base AS dev
|
|
|
|
|
|
|
|
|
|
RUN pecl install xdebug \
|
|
|
|
|
&& docker-php-ext-enable xdebug
|
|
|
|
|
|
2026-02-04 23:31:53 +01:00
|
|
|
COPY docker/php/php.ini /usr/local/etc/php/conf.d/zzz-minty-dev.ini
|
2026-03-22 13:23:27 +01:00
|
|
|
COPY docker/php/xdebug.ini /usr/local/etc/php/conf.d/zzz-xdebug.ini
|
2026-02-04 23:31:53 +01:00
|
|
|
|
2026-03-24 20:13:16 +01:00
|
|
|
# ── Production profile ───────────────────────────────────────────────
|
|
|
|
|
# No xdebug — smaller image, no debug overhead or attack surface.
|
|
|
|
|
FROM base AS prod
|
|
|
|
|
|
2026-05-29 11:50:45 +02:00
|
|
|
# Copy entire project into image
|
|
|
|
|
COPY . /var/www
|
|
|
|
|
|
|
|
|
|
# Install composer dependencies (no dev dependencies for production).
|
|
|
|
|
# NOTE: php.prod.ini (with open_basedir + disable_functions) is copied AFTER
|
|
|
|
|
# this step — composer needs unrestricted access to its own phar at /usr/bin/.
|
|
|
|
|
RUN composer install \
|
|
|
|
|
--no-dev \
|
|
|
|
|
--no-interaction \
|
|
|
|
|
--optimize-autoloader \
|
|
|
|
|
&& rm -rf /root/.composer/cache
|
|
|
|
|
|
|
|
|
|
# Apply production PHP hardening AFTER composer is done.
|
2026-03-24 20:13:16 +01:00
|
|
|
COPY docker/php/php.prod.ini /usr/local/etc/php/conf.d/zzz-minty-prod.ini
|
2026-05-29 11:50:45 +02:00
|
|
|
|
|
|
|
|
# Publish module web assets as real files (not symlinks) so web_init cp works correctly.
|
|
|
|
|
# Symlinks from web/modules/<id> → modules/<id>/web are replaced by actual copies,
|
|
|
|
|
# because web_init uses "cp -rp" which follows symlinks only to directories, not files.
|
|
|
|
|
RUN find /var/www/web/modules -maxdepth 1 -mindepth 1 -type l | while read link; do \
|
|
|
|
|
id=$(basename "$link"); \
|
|
|
|
|
target=$(readlink "$link"); \
|
|
|
|
|
rm "$link"; \
|
|
|
|
|
cp -r "$target" "/var/www/web/modules/$id"; \
|
|
|
|
|
done || true
|
|
|
|
|
|
|
|
|
|
# Create runtime directories (storage/ and var/ are excluded via .dockerignore;
|
|
|
|
|
# they will be mounted as volumes in production — we just ensure the paths exist).
|
|
|
|
|
RUN mkdir -p \
|
|
|
|
|
/var/www/storage/logs \
|
|
|
|
|
/var/www/storage/runtime \
|
|
|
|
|
/var/www/storage/users \
|
|
|
|
|
/var/www/var/cache \
|
|
|
|
|
/var/www/var/log \
|
|
|
|
|
/var/www/var/tmp \
|
|
|
|
|
&& chown -R www-data:www-data \
|
|
|
|
|
/var/www/storage \
|
|
|
|
|
/var/www/var
|
|
|
|
|
|
|
|
|
|
# Expose port for PHP-FPM
|
|
|
|
|
EXPOSE 9000
|