Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switched from phpdockerio/php72-fpm to official php image (in version…
… 7.2-fpm-alpine) - Alpine linux uses apk instead of apt-get - default UID for user "www-data" is 82 on Alpine linux instead of 33 - there is no bash installed, use sh instead
- Loading branch information
1 parent
c2e767d
commit 013978d
Showing
15 changed files
with
95 additions
and
75 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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,51 @@ | ||
FROM phpdockerio/php72-fpm:latest | ||
|
||
# Switch to non-interactive mode during image build to silence some warnings. | ||
# See https://github.com/moby/moby/issues/4032 | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install packages are useful when working in the container in interactive mode. | ||
RUN apt-get update && apt-get -y install apt-utils dialog | ||
|
||
# Install ACL support (ie. tools like "setfacl"). | ||
RUN apt-get update && apt-get -y install acl | ||
|
||
# Install Git - it is necessary for code diffs | ||
RUN apt-get update && apt-get -y install git | ||
FROM php:7.2-fpm-alpine | ||
|
||
# install git for computing diffs | ||
RUN apk add --update git | ||
|
||
# install Composer | ||
COPY docker-install-composer /usr/local/bin/docker-install-composer | ||
RUN chmod +x /usr/local/bin/docker-install-composer && docker-install-composer | ||
|
||
# libpng-dev needed by "gd" extension | ||
# icu-dev needed by "intl" extension | ||
# postgresql-dev needed by "pgsql" extension | ||
# libzip-dev needed by "zip" extension | ||
# autoconf needed by "redis" extension | ||
RUN apk add --update \ | ||
libpng-dev \ | ||
icu-dev \ | ||
postgresql-dev \ | ||
libzip-dev \ | ||
autoconf | ||
|
||
# "zip" extension warns about deprecation if we do not use a system library | ||
RUN docker-php-ext-configure zip --with-libzip | ||
|
||
# install necessary PHP extensions requested by Composer | ||
RUN docker-php-ext-install \ | ||
bcmath \ | ||
gd \ | ||
intl \ | ||
opcache \ | ||
pgsql \ | ||
pdo_pgsql \ | ||
zip | ||
|
||
# redis PHP extension is not provided with the PHP source and must be installed via PECL, build-base used only for installation | ||
RUN apk add --update build-base && pecl install redis-4.0.2 && docker-php-ext-enable redis && apk del build-base | ||
|
||
# install npm | ||
RUN apk add --update nodejs-npm | ||
|
||
# install grunt-cli using npm to be able to run grunt watch | ||
RUN npm install -g grunt-cli | ||
|
||
# Install PostgreSQL client for dumping database | ||
RUN apt-get update && apt-get -y install postgresql-client-9.5 | ||
# install postgresql to allow execution of pg_dump for acceptance tests (using older repository to install version 9.5) | ||
RUN apk add --update --no-cache --repository https://dl-3.alpinelinux.org/alpine/v3.4/main "postgresql<9.6" | ||
|
||
# Install locales and switch to en_US.utf8 in order to enable UTF-8 support. | ||
# See https://perlgeek.de/en/article/set-up-a-clean-utf8-environment | ||
RUN apt-get update && apt-get -y install locales-all | ||
# install locales and switch to en_US.utf8 in order to enable UTF-8 support | ||
# see https://github.com/docker-library/php/issues/240#issuecomment-305038173 | ||
RUN apk add --update --no-cache --repository https://dl-3.alpinelinux.org/alpine/edge/testing gnu-libiconv | ||
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php | ||
ENV LC_ALL=en_US.utf8 LANG=en_US.utf8 LANGUAGE=en_US.utf8 | ||
|
||
# Install required PHP extensions | ||
RUN apt-get update && apt-get -y --no-install-recommends install \ | ||
php7.2-bcmath \ | ||
php7.2-ctype \ | ||
php7.2-curl \ | ||
php7.2-fpm \ | ||
php7.2-gd \ | ||
php7.2-iconv \ | ||
php7.2-intl \ | ||
php7.2-json \ | ||
php7.2-mbstring \ | ||
php7.2-opcache \ | ||
php7.2-pdo \ | ||
php7.2-pgsql \ | ||
php7.2-redis \ | ||
php7.2-simplexml \ | ||
php7.2-soap \ | ||
php7.2-xml \ | ||
php7.2-zip | ||
|
||
# Install Composer | ||
RUN php -r "copy('https://getcomposer.org/download/1.5.1/composer.phar', '/usr/local/bin/composer');" \ | ||
&& php -r "if (hash_file('SHA384', '/usr/local/bin/composer') === 'fd3800adeff12dde28e9238d2bb82ba6f887bc6d718eee3e3a5d4f70685a236b9e96afd01aeb0dbab8ae6211caeb1cbe') {echo 'Composer installed';} else {echo 'Hash invalid for downloaded composer.phar'; exit(1);}" \ | ||
&& chmod 0755 /usr/local/bin/composer \ | ||
&& /usr/local/bin/composer selfupdate --stable | ||
|
||
# Install Node.js v6 from NodeSource repository that also contains NPM. | ||
# See https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions | ||
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \ | ||
&& apt-get update && apt-get -y install nodejs=6.* | ||
|
||
# Install grunt-cli using npm to be able to run grunt watch. | ||
RUN npm install -g grunt-cli | ||
|
||
WORKDIR "/var/www/shopsys-framework" |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
|
||
# copied from https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md | ||
# option --filename=composer is used so it can be called without the .phar extension | ||
|
||
EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" | ||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | ||
ACTUAL_SIGNATURE="$(php -r "echo hash_file('SHA384', 'composer-setup.php');")" | ||
|
||
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] | ||
then | ||
>&2 echo 'ERROR: Invalid installer signature' | ||
rm composer-setup.php | ||
exit 1 | ||
fi | ||
|
||
php composer-setup.php --quiet --install-dir=/usr/local/bin --filename=composer | ||
RESULT=$? | ||
rm composer-setup.php | ||
exit $RESULT |
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