-
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Dockerfile
124 lines (112 loc) · 3.2 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
FROM php:8.4-fpm-bookworm
LABEL maintainer="Mark Shust <[email protected]>"
ARG APP_ID=1000
RUN groupadd -g "$APP_ID" app \
&& useradd -g "$APP_ID" -u "$APP_ID" -d /var/www -s /bin/bash app
RUN mkdir -p /etc/nginx/html /var/www/html /sock \
&& chown -R app:app /etc/nginx /var/www /usr/local/etc/php/conf.d /sock
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get update && apt-get install -y \
cron \
default-mysql-client \
git \
gnupg \
gzip \
libbz2-dev \
libfreetype6-dev \
libicu-dev \
libjpeg62-turbo-dev \
libmagickwand-dev \
libmcrypt-dev \
libonig-dev \
libpng-dev \
libsodium-dev \
libssh2-1-dev \
libwebp-dev \
libxslt1-dev \
libzip-dev \
lsof \
mailutils \
msmtp \
nodejs \
procps \
rsync \
strace \
vim \
zip \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
RUN pecl channel-update pecl.php.net \
&& pecl install redis-6.1.0 \
&& pecl install ssh2-1.4.1 \
&& pecl install swoole-6.0.0RC1 \
&& pecl install xdebug-3.4.0beta1 \
&& pecl clear-cache \
&& rm -rf /tmp/pear
RUN imagick_branch="28f27044e435a2b203e32675e942eb8de620ee58" \
&& curl -L https://github.com/Imagick/imagick/archive/$imagick_branch.zip -o imagick.zip \
&& unzip imagick.zip \
&& rm imagick.zip \
&& cd imagick-$imagick_branch \
&& phpize \
&& ./configure --with-php-config=/usr/local/bin/php-config \
&& make \
&& make install \
&& echo "extension=imagick.so" >> $PHP_INI_DIR/conf.d/imagick.ini \
&& cd .. \
&& rm -rf imagick-$imagick_branch
RUN docker-php-ext-configure \
gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install \
bcmath \
bz2 \
calendar \
exif \
ftp \
gd \
gettext \
intl \
mbstring \
mysqli \
opcache \
pcntl \
pdo_mysql \
soap \
sockets \
sodium \
sysvmsg \
sysvsem \
sysvshm \
xsl \
zip \
&& docker-php-ext-enable \
imagick \
redis \
ssh2 \
xdebug
# Temporary workaround for PHP 8.4
RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
&& version=83 \
&& architecture=$(uname -m) \
&& curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/$architecture/$version \
&& mkdir -p /tmp/blackfire \
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
RUN git clone --branch v0.4.17 --depth=1 https://github.com/NoiseByNorthwest/php-spx.git /usr/lib/php-spx \
&& cd /usr/lib/php-spx \
&& phpize \
&& ./configure \
&& make \
&& make install
RUN curl -sS https://getcomposer.org/installer | \
php -- --version=2.7.9 --install-dir=/usr/local/bin --filename=composer
COPY conf/blackfire.ini $PHP_INI_DIR/conf.d/blackfire.ini
COPY conf/spx.ini $PHP_INI_DIR/conf.d/spx.ini
COPY conf/msmtprc /etc/msmtprc
COPY conf/php.ini $PHP_INI_DIR
COPY conf/php-fpm.conf /usr/local/etc/
COPY conf/www.conf /usr/local/etc/php-fpm.d/
USER app:app
VOLUME /var/www
WORKDIR /var/www/html