Files
mydev 89fd137aca feat: add PostgreSQL support with Compose profiles
- Add db-postgres service behind 'postgres' profile (MariaDB moved to 'mariadb' profile)
- Both databases aliased as 'db'; PHP waits for healthy DB (Compose >= 2.20)
- Pass DB_TYPE to the PHP container
- New PHP extensions: pdo_pgsql, gd, bcmath
- Upgrade Node.js to v26.x
- Update README with database selection docs and v1.2.0 changelog
2026-11-01 12:41:43 +02:00

98 lines
2.2 KiB
Docker

ARG PHP_VERSION
FROM dunglas/frankenphp:php${PHP_VERSION}-trixie AS base
# add additional extensions here:
RUN install-php-extensions \
pdo_mysql \
pdo_pgsql \
gd \
bcmath \
mbstring \
curl \
xml \
dom \
fileinfo \
intl \
zip \
opcache \
ctype \
iconv \
openssl \
tokenizer \
redis \
simplexml
# Install Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
RUN chmod +x /usr/bin/composer
# -------------------------
# Node.js layer
# -------------------------
FROM base AS node
RUN apt-get update \
&& apt-get install -y curl gnupg \
&& curl -fsSL https://deb.nodesource.com/setup_26.x | bash - \
&& apt-get install -y nodejs \
&& node -v \
&& npm -v \
&& rm -rf /var/lib/apt/lists/*
# -------------------------
# Symfony profile
# -------------------------
FROM node AS symfony
RUN install-php-extensions \
apcu \
sodium
RUN curl -1sLf 'https://dl.cloudsmith.io/public/symfony/stable/setup.deb.sh' | bash \
&& apt-get install -y symfony-cli
# -------------------------
# Laravel profile
# -------------------------
FROM node AS laravel
RUN install-php-extensions \
sodium
# -------------------------
# WordPress profile
# -------------------------
FROM base AS wordpress
RUN install-php-extensions \
mysqli \
exif \
imagick
# Install WP-CLI
RUN curl -o /usr/local/bin/wp -L https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
&& chmod +x /usr/local/bin/wp
# -------------------------
# Magento 2 profile
# -------------------------
FROM base AS magento2
RUN install-php-extensions \
mysqli \
xsl \
soap \
bcmath \
sodium
# -------------------------
# OpenCart profile
# -------------------------
FROM base AS opencart
RUN install-php-extensions \
mysqli
# Fix permissions for storage & cache (FrankenPHP runs as UID 65534 = nobody)
RUN if [ -d /app/storage ]; then chown -R 65534:65534 /app/storage /app/bootstrap/cache; fi
ARG MODE
# production mode: direct run container on server
RUN if [ "$MODE" = "prod" ]; then \
# Enable PHP production settings
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"; \
fi