forked from crater-invoice-inc/crater
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5321871
commit 423e30b
Showing
3 changed files
with
45 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,40 @@ | ||
FROM php:7.4-fpm-alpine | ||
FROM php:7.4-fpm | ||
|
||
WORKDIR /var/www | ||
# Arguments defined in docker-compose.yml | ||
ARG user | ||
ARG uid | ||
|
||
RUN apk add --no-cache \ | ||
$PHPIZE_DEPS \ | ||
freetype-dev \ | ||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
git \ | ||
zip \ | ||
libzip-dev \ | ||
php7-bcmath \ | ||
curl \ | ||
unzip \ | ||
libjpeg-turbo-dev \ | ||
libpng-dev \ | ||
libonig-dev \ | ||
libxml2-dev \ | ||
mariadb-client \ | ||
sqlite \ | ||
php7-json \ | ||
php7-openssl \ | ||
php7-pdo \ | ||
php7-pdo_mysql \ | ||
php7-session \ | ||
php7-simplexml \ | ||
php7-tokenizer \ | ||
php7-xml \ | ||
imagemagick \ | ||
imagemagick-libs \ | ||
imagemagick-dev \ | ||
php7-imagick \ | ||
php7-pcntl \ | ||
--repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ gnu-libiconv=1.15-r3 | ||
|
||
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php | ||
|
||
RUN printf "\n" | pecl install \ | ||
imagick && \ | ||
docker-php-ext-enable --ini-name 20-imagick.ini imagick | ||
|
||
RUN docker-php-ext-configure zip | ||
RUN docker-php-ext-install zip | ||
RUN docker-php-ext-install iconv pdo pdo_mysql bcmath pcntl exif | ||
RUN docker-php-ext-configure gd --with-jpeg --with-freetype | ||
RUN docker-php-ext-install gd | ||
|
||
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | ||
&& php composer-setup.php \ | ||
&& php -r "unlink('composer-setup.php');" \ | ||
&& mv composer.phar /usr/bin/composer | ||
zip \ | ||
unzip \ | ||
libzip-dev \ | ||
libmagickwand-dev \ | ||
mariadb-client | ||
|
||
# Clear cache | ||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pecl install imagick \ | ||
&& docker-php-ext-enable imagick | ||
|
||
# Install PHP extensions | ||
RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl bcmath gd | ||
|
||
# Get latest Composer | ||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer | ||
|
||
# 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 | ||
|
||
# Set working directory | ||
WORKDIR /var/www | ||
|
||
USER $user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters