-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
70 lines (60 loc) · 2.1 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# syntax=docker/dockerfile:1.4
ARG BASE_IMAGE=php:8.3-cli
FROM $BASE_IMAGE
ARG BASE_IMAGE=php:8.3-cli
WORKDIR /var/www
ENV PATH /var/www/vendor/bin:/home/dev/.composer/vendor/bin/:$PATH
ENV COMPOSER_HOME /home/dev/.composer
RUN groupadd --gid 1000 dev \
&& useradd --system --create-home --uid 1000 --gid 1000 --shell /bin/bash dev
RUN apt-get update \
&& apt-get install -y \
apt-transport-https \
autoconf \
build-essential \
curl \
git \
less \
libgmp-dev \
libicu-dev \
libpng-dev \
libsodium-dev \
libxml2-dev \
libzip-dev \
pkg-config \
unzip \
zlib1g-dev \
&& apt-get clean
RUN docker-php-ext-install -j$(nproc) \
bcmath \
exif \
gmp \
intl \
opcache \
pcntl \
zip \
&& pecl install redis \
&& docker-php-ext-enable redis
RUN mkdir -p "/home/dev/.composer" \
&& mkdir -p "/home/dev/.bash_history" \
&& touch "/home/dev/.bash_history/.bash_history" \
&& chown -R "dev:dev" "/home/dev/" \
&& echo "PS1='[\[\e[32m\]$BASE_IMAGE\[\e[0m\]]:\[\e[96m\]\w \[\e[0m\]\\$ '" >> "/home/dev/.bashrc" \
&& echo "export PROMPT_COMMAND='history -a' && export HISTFILE=/home/dev/.bash_history/.bash_history" >> "/home/dev/.bashrc" \
&& echo "alias c='clear'" >> "/home/dev/.bashrc" \
&& echo "error_reporting=E_ALL" >> "/usr/local/etc/php/conf.d/settings.ini" \
&& echo "display_errors=on" >> "/usr/local/etc/php/conf.d/settings.ini" \
&& echo "log_errors=on" >> "/usr/local/etc/php/conf.d/settings.ini"
COPY --link --from=composer/composer:latest-bin /composer /usr/bin/composer
USER dev
RUN composer global config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true \
&& composer global require \
dealerdirect/phpcodesniffer-composer-installer \
php-parallel-lint/php-parallel-lint \
phpstan/phpstan \
psy/psysh \
rector/rector \
slevomat/coding-standard \
squizlabs/php_codesniffer \
icanhazstring/composer-unused \
maglnet/composer-require-checker