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
# Arguments defined in docker-compose.yml
ARG user
ARG uid
# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
libzip-dev \
-y mariadb-client
# make sure apt is up to date
RUN apt-get update --fix-missing
RUN apt-get install -y curl
RUN apt-get install -y build-essential libssl-dev zlib1g-dev libpng-dev libjpeg-dev libfreetype6-dev
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 9.2.0
# Install PHP extensions
RUN docker-php-ext-install zip mysqli pdo_mysql mbstring exif pcntl bcmath gd && docker-php-ext-enable mysqli
# Install nvm with node and npm
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
RUN useradd -G www-data,root -u $uid -d /home/$user $user
RUN mkdir -p /home/$user/.composer && \
chown -R $user:$user /home/$user
WORKDIR /var/www/html
# Set working directory
WORKDIR /var/www
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& 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");
$request->validate(
[
'tourplan'=>'required|mimes:pdf|max:2048'
'tourplan'=>'required|mimes:pdf'
]
);

View file

@ -12,7 +12,7 @@
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",
"intervention/image": "^2.5",
"intervention/image": "^2.7",
"laravel/framework": "^7.0",
"laravel/tinker": "^2.0",
"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",
"This file is @generated automatically"
],
"content-hash": "4af2c0988de33886777dc666c57dc670",
"content-hash": "0d61eee26e8cdcfbf0b14b7ad5f15440",
"packages": [
{
"name": "asm89/stack-cors",
@ -824,16 +824,16 @@
},
{
"name": "intervention/image",
"version": "2.7.1",
"version": "2.7.2",
"source": {
"type": "git",
"url": "https://github.com/Intervention/image.git",
"reference": "744ebba495319501b873a4e48787759c72e3fb8c"
"reference": "04be355f8d6734c826045d02a1079ad658322dad"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Intervention/image/zipball/744ebba495319501b873a4e48787759c72e3fb8c",
"reference": "744ebba495319501b873a4e48787759c72e3fb8c",
"url": "https://api.github.com/repos/Intervention/image/zipball/04be355f8d6734c826045d02a1079ad658322dad",
"reference": "04be355f8d6734c826045d02a1079ad658322dad",
"shasum": ""
},
"require": {
@ -876,8 +876,8 @@
"authors": [
{
"name": "Oliver Vogel",
"email": "oliver@olivervogel.com",
"homepage": "http://olivervogel.com/"
"email": "oliver@intervention.io",
"homepage": "https://intervention.io/"
}
],
"description": "Image handling and manipulation library with support for Laravel integration",
@ -892,11 +892,11 @@
],
"support": {
"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": [
{
"url": "https://www.paypal.me/interventionphp",
"url": "https://paypal.me/interventionio",
"type": "custom"
},
{
@ -904,7 +904,7 @@
"type": "github"
}
],
"time": "2021-12-16T16:49:26+00:00"
"time": "2022-05-21T17:30:32+00:00"
},
{
"name": "laravel/framework",

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB