Multiple implementations of the same back-end application. The aim is to provide quick, side-by-side comparisons of different technologies (languages, frameworks, libraries) while preserving consistent business logic across all implementations.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

70 lines
2.3 KiB

FROM php:8.2-fpm-alpine
# Install system dependencies and development tools
RUN apk add --no-cache \
$PHPIZE_DEPS \
icu-dev \
libzip-dev \
libpng-dev \
jpeg-dev \
freetype-dev \
linux-headers \
git \
vim \
curl \
shadow \
sudo
RUN pecl install xdebug && docker-php-ext-enable xdebug
RUN apk add icu-dev
RUN docker-php-ext-install \
intl \
pdo_mysql \
zip \
gd
# Configure PHP for development, xdebug.client_host=127.0.0.1 for in-container xdebug server
RUN echo "memory_limit = 512M" > /usr/local/etc/php/conf.d/custom.ini \
&& echo "upload_max_filesize = 100M" >> /usr/local/etc/php/conf.d/custom.ini \
&& echo "post_max_size = 100M" >> /usr/local/etc/php/conf.d/custom.ini \
&& echo "max_execution_time = 300" >> /usr/local/etc/php/conf.d/custom.ini \
&& echo "display_errors = On" >> /usr/local/etc/php/conf.d/custom.ini \
&& echo "display_startup_errors = On" >> /usr/local/etc/php/conf.d/custom.ini \
&& echo "error_reporting = E_ALL" >> /usr/local/etc/php/conf.d/custom.ini \
&& echo "xdebug.mode=debug,develop" >> /usr/local/etc/php/conf.d/custom.ini \
&& echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/custom.ini \
&& echo "xdebug.client_host=127.0.0.1" >> /usr/local/etc/php/conf.d/custom.ini \
&& echo "xdebug.client_port=9003" >> /usr/local/etc/php/conf.d/custom.ini \
&& echo "xdebug.idekey=VSCODE" >> /usr/local/etc/php/conf.d/custom.ini
# Set working directory
WORKDIR /var/www/html
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Configure user permissions
ARG USER_ID=1000
ARG GROUP_ID=1000
# Create a user with matching UID/GID
RUN if getent passwd $USER_ID > /dev/null 2>&1; then \
usermod -u $USER_ID -g $GROUP_ID www-data; \
else \
addgroup -g $GROUP_ID developer; \
adduser -D -u $USER_ID -G developer -s /bin/sh developer; \
echo '%developer ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/developer; \
chmod 0440 /etc/sudoers.d/developer; \
usermod -a -G developer www-data; \
fi
RUN chown -R $USER_ID:$GROUP_ID /var/www/html
USER $USER_ID:$GROUP_ID
# Expose port 9000 for PHP-FPM
EXPOSE 9000
# Start PHP-FPM
CMD ["php-fpm"]