-
Notifications
You must be signed in to change notification settings - Fork 18
/
Dockerfile
54 lines (41 loc) · 1.5 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
FROM php:8.1-fpm
ARG WITH_XDEBUG=false
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get update -y && apt-get install -y \
libpng-dev \
libjpeg-dev \
libzip-dev \
unzip \
git \
nodejs
# Adding PHP extensions
RUN docker-php-ext-configure gd --with-jpeg \
&& docker-php-ext-install \
pdo_mysql \
gd \
zip \
exif
RUN pecl install redis \
&& docker-php-ext-enable redis \
&& rm -rf /tmp/pear
RUN echo "memory_limit=512M" > $PHP_INI_DIR/conf.d/memory-limit.ini
RUN if [ $WITH_XDEBUG = "true" ] ; then \
pecl install xdebug; \
docker-php-ext-enable xdebug; \
echo "error_reporting=E_ALL" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \
echo "display_startup_errors=On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \
echo "display_errors=On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \
echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \
echo "xdebug.remote_connect_back=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \
fi ;
# Install php dependencies
COPY --from=composer:2.3.9 /usr/bin/composer /usr/bin/composer
WORKDIR /var/www
COPY package.json package-lock.json ./
RUN npm install
# Install app dependencies
COPY composer.json composer.lock ./
RUN composer install --no-autoloader --no-scripts
COPY . .
# Re-run composer, this time with autoloader & scripts
RUN composer install --optimize-autoloader