-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (37 loc) · 1.19 KB
/
Dockerfile
File metadata and controls
47 lines (37 loc) · 1.19 KB
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
ARG PHP_VERSION
ARG COMPOSER_VERSION
FROM composer:${COMPOSER_VERSION} as composer
FROM php:${PHP_VERSION}-fpm
ARG PHP_VERSION
ENV DEBIAN_FRONTEND noninteractive
# Install dependencies
RUN apt update && \
apt install -y --no-install-recommends \
git \
rsync \
zip \
unzip \
libicu-dev \
pkg-config \
curl \
&& \
# Add Node.js repository and install Node.js 20.x and npm
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
RUN case ${PHP_VERSION} in \
8.0|8.1|8.2|8.3 ) pecl install xdebug-3.3.2 && docker-php-ext-enable xdebug;; \
*) pecl install xdebug-2.9.8 && docker-php-ext-enable xdebug;; \
esac
# Install PHP extensions
RUN docker-php-ext-install intl
RUN usermod -u 1000 www-data
RUN groupmod -g 1000 www-data
RUN mkdir -p /app/vendor && chown -R www-data:www-data /app
USER www-data
WORKDIR /app
COPY --link .docker/php.ini /usr/local/etc/php/php.ini
COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY --link composer.json ./
RUN composer install --prefer-dist --no-progress --no-cache