Skip to content

Commit 1405630

Browse files
committed
update audio codec and php version
1 parent d41032d commit 1405630

File tree

1 file changed

+58
-74
lines changed

1 file changed

+58
-74
lines changed

fpm-alpine/8.3/dockerfile

Lines changed: 58 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM php:8.3.9-alpine3.20
1+
FROM php:8.3.13-alpine3.20
22

33
# Set the maintainer label
44
LABEL Maintainer="Kazem Mirzaei <k90mirzaei@gmail.com>"
5-
LABEL Description="PHP-FPM v8.2 with essential extensions on top of Alpine Linux."
5+
LABEL Description="PHP-FPM v8.3 with essential extensions and FFmpeg with libfdk-aac support on Alpine Linux."
66

77
# Set environment variables for the user and group
88
ENV USER www
@@ -11,17 +11,14 @@ ENV GROUP www
1111
# Switch to root user to perform system updates and installations
1212
USER root
1313

14-
1514
#############################################
16-
### Install and enable PHP extensions
15+
### Install system dependencies and PHP extensions
1716
#############################################
1817

19-
# Install system dependencies
2018
RUN set -ex \
19+
# Install system dependencies
2120
&& apk add --update --no-cache \
22-
c-client \
2321
freetype \
24-
ffmpeg \
2522
gettext \
2623
gmp \
2724
icu-libs \
@@ -35,13 +32,11 @@ RUN set -ex \
3532
libxpm \
3633
libxslt \
3734
libzip \
38-
make \
3935
mysql-client \
40-
tzdata
41-
42-
# Development dependencies
43-
RUN set -ex \
44-
&& apk add --update --no-cache \
36+
tzdata \
37+
\
38+
# Development dependencies
39+
&& apk add --update --no-cache --virtual .build-deps \
4540
autoconf \
4641
curl-dev \
4742
freetype-dev \
@@ -65,87 +60,76 @@ RUN set -ex \
6560
pcre-dev \
6661
pkgconf \
6762
zlib-dev \
63+
nasm \
64+
yasm \
65+
tar \
66+
build-base \
67+
fdk-aac-dev \
68+
lame-dev \
69+
libass-dev \
70+
libvpx-dev \
71+
libvorbis-dev \
72+
libogg-dev \
73+
libtheora-dev \
74+
opus-dev \
6875
\
6976
################################
7077
# Install PHP extensions
7178
################################
7279
\
7380
# Install gd
7481
&& ln -s /usr/lib/$(apk --print-arch)-linux-gnu/libXpm.* /usr/lib/ \
75-
&& docker-php-ext-configure gd \
76-
--enable-gd \
77-
--with-webp \
78-
--with-jpeg \
79-
--with-xpm \
80-
--with-freetype \
81-
--enable-gd-jis-conv \
82+
&& docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype --enable-gd-jis-conv \
8283
&& docker-php-ext-install -j$(nproc) gd \
83-
&& true \
8484
\
85-
# Install gettext
86-
&& docker-php-ext-install -j$(nproc) gettext \
87-
&& true \
88-
\
89-
# Install gmp
90-
&& docker-php-ext-install -j$(nproc) gmp \
91-
&& true \
92-
\
93-
# Install bcmath
94-
&& docker-php-ext-install -j$(nproc) bcmath \
95-
&& true \
96-
\
97-
# Install exif
98-
&& docker-php-ext-install -j$(nproc) exif \
99-
&& true \
100-
\
101-
# Install imap
102-
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl --with-imap \
85+
# Install gettext, gmp, bcmath, exif, intl, imap, pdo_mysql, pcntl, zip, redis, imagick
86+
&& docker-php-ext-install -j$(nproc) gettext gmp bcmath exif intl pdo pdo_mysql pcntl zip \
87+
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
10388
&& docker-php-ext-install -j$(nproc) imap \
104-
&& true \
105-
\
106-
# Install imagick
107-
&& pecl install imagick \
108-
&& docker-php-ext-enable imagick \
109-
&& true \
110-
\
111-
# Install intl
112-
&& docker-php-ext-install -j$(nproc) intl \
113-
&& true \
114-
\
115-
# Install pdo_mysql
116-
&& docker-php-ext-configure pdo_mysql --with-zlib-dir=/usr \
117-
&& docker-php-ext-install -j$(nproc) pdo pdo_mysql \
118-
&& true \
119-
\
120-
# Install pcntl
121-
&& docker-php-ext-install -j$(nproc) pcntl \
122-
&& true \
123-
\
124-
# Install redis
125-
&& pecl install --force redis \
126-
&& docker-php-ext-enable redis \
127-
&& true \
128-
\
129-
# Install zip
130-
&& docker-php-ext-configure zip --with-zip \
131-
&& docker-php-ext-install -j$(nproc) zip \
132-
&& true \
89+
&& pecl install imagick redis \
90+
&& docker-php-ext-enable imagick redis \
13391
\
13492
# Clean up build packages
13593
&& docker-php-source delete \
136-
&& rm -fr /tmp/pear \
94+
&& rm -fr /tmp/pear \
13795
&& rm -rf /var/cache/apk/* \
138-
&& true
96+
\
97+
#############################################
98+
### Install and compile FFmpeg with libfdk-aac
99+
#############################################
100+
\
101+
&& mkdir -p /usr/src/ffmpeg \
102+
&& cd /usr/src/ffmpeg \
103+
&& wget https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 \
104+
&& tar xjf ffmpeg-snapshot.tar.bz2 \
105+
&& cd ffmpeg \
106+
&& ./configure --prefix=/usr \
107+
--enable-gpl \
108+
--enable-nonfree \
109+
--enable-libfdk-aac \
110+
--enable-libmp3lame \
111+
--enable-libass \
112+
--enable-libvpx \
113+
--enable-libx264 \
114+
--enable-libwebp \
115+
--enable-libvorbis \
116+
--enable-libtheora \
117+
--enable-opus \
118+
&& make -j$(nproc) \
119+
&& make install \
120+
&& cd / \
121+
&& rm -rf /usr/src/ffmpeg \
122+
&& apk del .build-deps
139123

140124
# Install Composer
141125
RUN wget https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer -O - -q | php -- --quiet \
142126
&& mv composer.phar /usr/local/bin/composer \
143127
&& addgroup -S composer \
144128
&& adduser -S composer -G composer \
145-
&& composer --version \
146-
&& true
129+
&& composer --version
147130

131+
# Expose PHP-FPM port
132+
EXPOSE 9000
148133

149134
# Start PHP-FPM
150-
EXPOSE 9000
151-
CMD ["php-fpm"]
135+
CMD ["php-fpm"]

0 commit comments

Comments
 (0)