Skip to content

Commit

Permalink
dockerfile php8.2 (#2121)
Browse files Browse the repository at this point in the history
* dockerfile php8.2

* uploads and memory

* Update Dockerfile

* Update Dockerfile
  • Loading branch information
willph authored May 13, 2023
1 parent c0e4a56 commit a67e1ff
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 1 deletion.
1 change: 1 addition & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ services:
restart: always
volumes:
- "./etc/php/php.ini:/usr/local/etc/php/conf.d/php.ini"
- "./etc/php/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini"
- "../:/var/www/html"

composer:
Expand Down
1 change: 1 addition & 0 deletions docker/etc/nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ server {

root /var/www/html;
index index.html index.php;
client_max_body_size 64M;

# set expiration of assets to MAX for caching
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
Expand Down
1 change: 1 addition & 0 deletions docker/etc/nginx/default.template.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ server {

root /var/www/html;
index index.html index.php;
client_max_body_size 64M;

# set expiration of assets to MAX for caching
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
Expand Down
59 changes: 58 additions & 1 deletion docker/etc/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,61 @@
FROM nanoninja/php-fpm:7.4.0
FROM php:8.2.5-fpm

# Install extension
RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y \
g++ \
libbz2-dev \
libc-client-dev \
libcurl4-gnutls-dev \
libedit-dev \
libfreetype6-dev \
libicu-dev \
libjpeg62-turbo-dev \
libkrb5-dev \
libldap2-dev \
libldb-dev \
libmagickwand-dev \
libmcrypt-dev \
libmemcached-dev \
libpng-dev \
libpq-dev \
libsqlite3-dev \
libssl-dev \
libreadline-dev \
libxslt1-dev \
libzip-dev \
memcached \
wget \
unzip \
zlib1g-dev \
&& docker-php-ext-install -j$(nproc) \
bcmath \
bz2 \
calendar \
exif \
gettext \
mysqli \
opcache \
pdo_mysql \
xsl \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd \
&& PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
&& docker-php-ext-install -j$(nproc) imap \
&& docker-php-ext-configure intl \
&& docker-php-ext-install -j$(nproc) intl \
&& docker-php-ext-configure zip \
&& docker-php-ext-install zip \
&& CFLAGS="$CFLAGS -D_GNU_SOURCE" docker-php-ext-install sockets \
&& pecl install xmlrpc-1.0.0RC3 && docker-php-ext-enable xmlrpc \
&& pecl install memcached && docker-php-ext-enable memcached \
&& pecl install redis && docker-php-ext-enable redis \
&& yes '' | pecl install imagick && docker-php-ext-enable imagick \
&& docker-php-source delete \
&& apt-get remove -y g++ wget \
&& apt-get autoremove --purge -y && apt-get autoclean -y && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* /var/tmp/*

# Permission for PHP to write in volumes
RUN usermod -u 1000 www-data
Expand Down
5 changes: 5 additions & 0 deletions docker/etc/php/uploads.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
file_uploads = On
memory_limit = 128M
upload_max_filesize = 10M
post_max_size = 10M
max_execution_time = 600

0 comments on commit a67e1ff

Please sign in to comment.