Dockerfile.test•1.18 kB
# Test runner Dockerfile
FROM php:8.4-cli@sha256:24a6d741b50242e8a9bd8eb14345790e5266eb8314c528a254ce8c014e961e9d
# Install system dependencies and PHP extensions
RUN apt-get update && apt-get install -y \
git \
curl \
wget \
libzip-dev \
unzip \
&& rm -rf /var/lib/apt/lists/*
# Install PHP extensions
RUN docker-php-ext-install zip
# Install Xdebug for code coverage
RUN pecl install xdebug && docker-php-ext-enable xdebug
# Install Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /app
# Copy composer files first
COPY composer.json composer.lock ./
# Install dependencies
RUN composer install --no-interaction --prefer-dist
# Copy source code
COPY src ./src
COPY bin ./bin
# Copy test configuration file
COPY phpunit.xml ./
# Copy tests directory
COPY tests ./tests
# Copy documentation directory for integration tests
COPY docs ./docs
# Ensure coverage and output directories exist
RUN mkdir -p coverage output
CMD ["vendor/bin/pest", "--testsuite", "integration", "--coverage", "--coverage-cobertura", "coverage/integration-cobertura.xml", "--log-junit", "output/integration-junit.xml"]