Fixed Dockerfile for php/gd Image functions for Intervention Library

This commit is contained in:
Torsten 2023-01-17 14:53:35 +01:00
parent 3897df1ad7
commit 62335f4db5
6 changed files with 33 additions and 38 deletions

View file

@ -1,36 +1,31 @@
FROM php:7.2-fpm FROM php:7.2-fpm
# Arguments defined in docker-compose.yml # Replace shell with bash so we can source files
ARG user RUN rm /bin/sh && ln -s /bin/bash /bin/sh
ARG uid
# Install system dependencies # make sure apt is up to date
RUN apt-get update && apt-get install -y \ RUN apt-get update --fix-missing
git \ RUN apt-get install -y curl
curl \ RUN apt-get install -y build-essential libssl-dev zlib1g-dev libpng-dev libjpeg-dev libfreetype6-dev
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
libzip-dev \
-y mariadb-client
# Clear cache ENV NVM_DIR /usr/local/nvm
RUN apt-get clean && rm -rf /var/lib/apt/lists/* ENV NODE_VERSION 9.2.0
# Install PHP extensions # Install nvm with node and npm
RUN docker-php-ext-install zip mysqli pdo_mysql mbstring exif pcntl bcmath gd && docker-php-ext-enable mysqli RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash \
&& source $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
# Create system user to run Composer and Artisan Commands WORKDIR /var/www/html
RUN useradd -G www-data,root -u $uid -d /home/$user $user
RUN mkdir -p /home/$user/.composer && \
chown -R $user:$user /home/$user
# Set working directory RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
WORKDIR /var/www && docker-php-ext-install gd
USER $user RUN docker-php-ext-install pdo pdo_mysql mysqli
RUN usermod -u 1000 www-data

View file

@ -18,7 +18,7 @@ class AdminController extends Controller
Log::debug("Store Tourplan"); Log::debug("Store Tourplan");
$request->validate( $request->validate(
[ [
'tourplan'=>'required|mimes:pdf|max:2048' 'tourplan'=>'required|mimes:pdf'
] ]
); );

View file

@ -12,7 +12,7 @@
"fideloper/proxy": "^4.2", "fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0", "fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3", "guzzlehttp/guzzle": "^6.3",
"intervention/image": "^2.5", "intervention/image": "^2.7",
"laravel/framework": "^7.0", "laravel/framework": "^7.0",
"laravel/tinker": "^2.0", "laravel/tinker": "^2.0",
"laravel/ui": "^2.1" "laravel/ui": "^2.1"

View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "4af2c0988de33886777dc666c57dc670", "content-hash": "0d61eee26e8cdcfbf0b14b7ad5f15440",
"packages": [ "packages": [
{ {
"name": "asm89/stack-cors", "name": "asm89/stack-cors",
@ -824,16 +824,16 @@
}, },
{ {
"name": "intervention/image", "name": "intervention/image",
"version": "2.7.1", "version": "2.7.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Intervention/image.git", "url": "https://github.com/Intervention/image.git",
"reference": "744ebba495319501b873a4e48787759c72e3fb8c" "reference": "04be355f8d6734c826045d02a1079ad658322dad"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Intervention/image/zipball/744ebba495319501b873a4e48787759c72e3fb8c", "url": "https://api.github.com/repos/Intervention/image/zipball/04be355f8d6734c826045d02a1079ad658322dad",
"reference": "744ebba495319501b873a4e48787759c72e3fb8c", "reference": "04be355f8d6734c826045d02a1079ad658322dad",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -876,8 +876,8 @@
"authors": [ "authors": [
{ {
"name": "Oliver Vogel", "name": "Oliver Vogel",
"email": "oliver@olivervogel.com", "email": "oliver@intervention.io",
"homepage": "http://olivervogel.com/" "homepage": "https://intervention.io/"
} }
], ],
"description": "Image handling and manipulation library with support for Laravel integration", "description": "Image handling and manipulation library with support for Laravel integration",
@ -892,11 +892,11 @@
], ],
"support": { "support": {
"issues": "https://github.com/Intervention/image/issues", "issues": "https://github.com/Intervention/image/issues",
"source": "https://github.com/Intervention/image/tree/2.7.1" "source": "https://github.com/Intervention/image/tree/2.7.2"
}, },
"funding": [ "funding": [
{ {
"url": "https://www.paypal.me/interventionphp", "url": "https://paypal.me/interventionio",
"type": "custom" "type": "custom"
}, },
{ {
@ -904,7 +904,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-12-16T16:49:26+00:00" "time": "2022-05-21T17:30:32+00:00"
}, },
{ {
"name": "laravel/framework", "name": "laravel/framework",

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB