forked from nuwave/lighthouse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
php.dockerfile
41 lines (32 loc) · 1.03 KB
/
php.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
FROM php:8-cli
WORKDIR /workdir
RUN apt-get update && apt-get install -y \
git \
libzip-dev \
zip \
libicu-dev \
&& docker-php-ext-install \
zip \
mysqli \
pdo_mysql \
intl \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
RUN pecl install \
xdebug \
redis \
&& docker-php-ext-enable \
xdebug \
redis
RUN echo 'memory_limit=-1' > /usr/local/etc/php/conf.d/lighthouse.ini
RUN echo "alias phpunit='vendor/bin/phpunit'" >> ~/.bashrc
ARG USER
ARG USER_ID
ARG GROUP_ID
RUN if [ ${USER_ID:-0} -ne 0 ] && [ ${GROUP_ID:-0} -ne 0 ]; then \
groupadd --force --gid ${GROUP_ID} ${USER} &&\
useradd --no-log-init --uid ${USER_ID} --gid ${GROUP_ID} ${USER} &&\
install --directory --mode 0755 --owner ${USER} --group ${GROUP_ID} /home/${USER} &&\
chown --changes --silent --no-dereference --recursive ${USER_ID}:${GROUP_ID} /home/${USER} \
;fi
USER ${USER}