This increases the size of the container image, but reduces the reliance on the external volume for loading application data. This couples the application code to the container image rather than to the container state.
78 lines
1.6 KiB
Docker
78 lines
1.6 KiB
Docker
# Use the PHP 8.2 FPM image as the base
|
|
FROM php:8.2-fpm
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
libfreetype6-dev \
|
|
libjpeg62-turbo-dev \
|
|
libpng-dev \
|
|
libwebp-dev \
|
|
libxpm-dev \
|
|
zlib1g-dev \
|
|
libzip-dev \
|
|
libmariadb-dev \
|
|
libxml2-dev \
|
|
libldap2-dev \
|
|
libsmbclient-dev \
|
|
libcurl4-openssl-dev \
|
|
unzip \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Download and install the docker-php-extension-installer script
|
|
RUN curl -sSL https://github.com/mlocati/docker-php-extension-installer/releases/download/2.2.6/install-php-extensions -o /usr/local/bin/install-php-extensions \
|
|
&& chmod +x /usr/local/bin/install-php-extensions
|
|
|
|
# Install PHP extensions
|
|
RUN install-php-extensions \
|
|
ctype \
|
|
curl \
|
|
dom \
|
|
fileinfo \
|
|
gd \
|
|
hash \
|
|
json \
|
|
libxml \
|
|
mbstring \
|
|
openssl \
|
|
posix \
|
|
session \
|
|
simplexml \
|
|
xmlreader \
|
|
xmlwriter \
|
|
zip \
|
|
zlib \
|
|
pdo_mysql \
|
|
intl \
|
|
sodium \
|
|
ldap \
|
|
smbclient \
|
|
ftp \
|
|
imap \
|
|
bcmath \
|
|
gmp \
|
|
exif \
|
|
apcu \
|
|
memcached \
|
|
redis \
|
|
imagick \
|
|
sysvsem \
|
|
opcache
|
|
|
|
|
|
# Copy optimized php.ini-development and production
|
|
COPY ./php.ini-production /usr/local/etc/php/php.ini
|
|
|
|
# Set the working directory
|
|
WORKDIR /var/www/html
|
|
|
|
RUN curl -sSLo latest.zip https://download.nextcloud.com/server/releases/latest.zip
|
|
RUN unzip latest.zip
|
|
RUN rm latest.zip
|
|
RUN chown -R www-data:www-data nextcloud/
|
|
|
|
# Expose port 9000 for PHP-FPM
|
|
# EXPOSE 9000
|
|
|
|
# Start PHP-FPM
|
|
CMD ["sh", "-c", "php-fpm"]
|