forked from nuwave/lighthouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphp.dockerfile
More file actions
35 lines (26 loc) · 913 Bytes
/
php.dockerfile
File metadata and controls
35 lines (26 loc) · 913 Bytes
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
FROM php:7.4-cli
WORKDIR /workdir
RUN apt-get update && apt-get install -y \
git \
libzip-dev \
zip \
&& docker-php-ext-install \
zip \
mysqli \
pdo_mysql \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug
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 -g ${GROUP_ID} ${USER} &&\
useradd -l -u ${USER_ID} -g ${USER} ${USER} &&\
install -d -m 0755 -o ${USER} -g ${USER} /home/${USER} &&\
chown --changes --silent --no-dereference --recursive ${USER_ID}:${GROUP_ID} /home/${USER} \
;fi
USER ${USER}