-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
52 lines (43 loc) · 2.02 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
ARG PHP_VERSION=php8.3
FROM jakzal/phpqa:${PHP_VERSION}
LABEL maintainer="hussainweb@gmail.com"
ENV TARGET_DIR="/usr/local/lib/drupalqa"
WORKDIR ${TARGET_DIR}
# PAReview needs the file command. Also install other dependencies.
RUN apt-get update \
&& apt-get install --no-install-recommends -y pkg-config \
&& apt-get install --no-install-recommends -y \
autoconf \
build-essential \
file \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd -j$(nproc) \
&& apt-get remove -y autoconf build-essential libfreetype6-dev libjpeg62-turbo-dev libpng-dev pkg-config \
&& rm -rf /var/lib/apt/lists/*
RUN echo "{}" > composer.json && \
composer config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true && \
composer require --prefer-dist \
"squizlabs/php_codesniffer:^3.5" \
"drupal/coder:^8.3.7" \
"phpcompatibility/php-compatibility:^9.3" \
"slevomat/coding-standard:^8.0" \
&& \
git clone https://git.drupalcode.org/sandbox/coltrane-1921926.git drupalsecure && \
git clone https://github.com/klausi/pareviewsh.git && \
rm -rf ./drupalsecure/.git/ ./pareviewsh/.git/
# Let's remove the phpcs installed by phpqa as it cannot
# autoload classes required in Drupal code sniffs.
RUN rm $TOOLBOX_TARGET_DIR/phpcs && \
ln -s $TARGET_DIR/vendor/bin/phpcs $TOOLBOX_TARGET_DIR && \
ln -s $TARGET_DIR/pareviewsh/pareview.sh $TOOLBOX_TARGET_DIR/pareview && \
chmod +x $TOOLBOX_TARGET_DIR/pareview && \
phpcs --config-set installed_paths $TARGET_DIR/vendor/drupal/coder/coder_sniffer/,$TARGET_DIR/vendor/phpcompatibility/php-compatibility,$TARGET_DIR/drupalsecure,$TARGET_DIR/vendor/slevomat/coding-standard/
COPY tool-* /
RUN php $TOOLBOX_TARGET_DIR/toolbox install \
--tools=/tool-drupal-check.json \
--tools=/tool-grumphp.json \
&& rm -rf $COMPOSER_HOME/cache
CMD php $TOOLBOX_TARGET_DIR/toolbox list-tools