-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
48 lines (40 loc) · 1.09 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
ARG PHP_VERSION=8.1
FROM composer:2 as composer
FROM php:${PHP_VERSION}-fpm
ARG UID
ARG GID
# Install dependencies
RUN apt update && \
apt install -y --no-install-recommends \
git \
libicu-dev \
libpng-dev \
libxml2-dev \
libxslt-dev \
libzip-dev \
zlib1g-dev \
&& \
# Cleanup APT
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* && \
# Install PHP extensions
docker-php-ext-install -j$(nproc) \
bcmath \
gd \
intl \
pdo_mysql \
soap \
sockets \
xsl \
zip
RUN pecl install xdebug-3.3.2 \
&& docker-php-ext-enable xdebug
RUN getent group "$GID" || addgroup --gid "$GID" phpuser
RUN adduser --uid "$UID" --gid "$GID" --disabled-password phpuser
USER phpuser
WORKDIR /home/phpuser
ARG MAGENTO_VERSION=2.4.6-p6
RUN git clone --depth 1 --branch $MAGENTO_VERSION https://github.com/magento/magento2.git magento2
WORKDIR /home/phpuser/magento2
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN composer install --prefer-dist --no-progress && \
composer require alma/alma-php-client mockery/mockery