Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/vendor/
.phpunit.result.cache
composer.lock
.env
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"phpunit/phpunit": "^10.5.5 || ^11.0.0 || ^12.0.0",
"nikic/php-parser": "^4.18.0 || ^5.0.0",
"symfony/finder": "^6.4.0 || ^7.0.0 || ^8.0.0",
"phpdocumentor/reflection-docblock": "^5.3.0"
"phpdocumentor/reflection-docblock": "^5.3.0 || ^6.0.0"
},
"require-dev": {
"phpstan/phpstan": "^1.10.52",
Expand Down
14 changes: 14 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:
php:
container_name: phpunit-architecture-test
build:
args:
user: ${USER}
uid: ${USER_ID}
context: ./php
dockerfile: Dockerfile
volumes:
- "../:/var/www/html"
restart: always
environment:
COMPOSER_MEMORY_LIMIT: -1
41 changes: 41 additions & 0 deletions docker/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM php:8.4-fpm

# Arguments defined in docker-compose.yml
ARG user
ARG uid

# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libonig-dev \
libpq-dev \
libzip-dev \
libpng-dev \
zip \
unzip \
libicu-dev

# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# Install PHP extensions
RUN docker-php-ext-install mbstring pdo pdo_pgsql pgsql pcntl zip intl

# Xdebug
# RUN pecl install xdebug \
# && docker-php-ext-enable xdebug

# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# Create system user to run Composer and Artisan Commands
RUN useradd -G www-data,root -u $uid -d /home/$user $user
RUN mkdir -p /home/$user/.composer && \
chown -R $user:$user /home/$user

# Set working directory
WORKDIR /var/www/html

# Set user
USER $user