forked from fortrabbit/phpco-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (23 loc) · 922 Bytes
/
Dockerfile
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
FROM php:8.4-cli-alpine
# Install PHP CodeSniffer
ARG PHPCS_RELEASE="3.7.2"
RUN pear install PHP_CodeSniffer-$PHPCS_RELEASE
# Install the PHPCompatibility standard
ARG PHPCOMP_RELEASE="9.3.5"
RUN set -eux &&\
apk --no-cache add git &&\
mkdir -p "/opt/" &&\
cd "/opt/" &&\
git clone -v --single-branch --depth 1 https://github.com/PHPCompatibility/PHPCompatibility.git --branch $PHPCOMP_RELEASE &&\
rm -rf PHPCompatibility/.git &&\
apk del git
# Configure phpcs defaults
RUN phpcs --config-set installed_paths /opt/PHPCompatibility &&\
phpcs --config-set default_standard PHPCompatibility &&\
phpcs --config-set testVersion 7.4 &&\
phpcs --config-set report_width 120
# Configure PHP with all the memory we might need (unlimited)
RUN echo "memory_limit = -1" >> /usr/local/etc/php/conf.d/memory.ini
WORKDIR /mnt/src
ENTRYPOINT ["/usr/local/bin/phpcs"]
CMD ["-p", "--colors", "."]