-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.php-qa
More file actions
37 lines (30 loc) · 926 Bytes
/
Dockerfile.php-qa
File metadata and controls
37 lines (30 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM php:8.4-cli-alpine
# Install git and other tools needed for QA
RUN apk add --no-cache git
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Create app directory
WORKDIR /app
# Create a minimal composer.json for QA tools
RUN echo '{\
"name": "lts-site/code-qa",\
"description": "Code quality analysis tools",\
"type": "project",\
"require": {\
"phpstan/phpstan": "^2.1",\
"friendsofphp/php-cs-fixer": "^3.64"\
},\
"config": {\
"allow-plugins": {\
"dealerdirect/phpcodesniffer-composer-installer": true\
},\
"bin-dir": "bin"\
}\
}' > composer.json
# Install QA tools
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN composer install --optimize-autoloader
# Set up working directory for code snippets
WORKDIR /code-snippets
# Default command
CMD ["/app/bin/phpstan", "analyse", ".", "--level=8", "--no-progress"]