Add initial support for PHP7 (#97)
* Add initial support for PHP7 * Update PHP env with now an PSR3 logger (Monolog). Now you can also create a handler function with PSR7 Http message and PSR3 logger in parameter. * Add examples for PHP7 environement * For development you can create a function in this path /app/userfuncdev.php it will be loaded * Switch to alpine base image * handler now receive an array with request, response and logger object
This commit is contained in:
committed by
Soam Vasani
parent
c353e7f230
commit
2725da6b1b
@@ -0,0 +1,73 @@
|
||||
FROM php:7.1-alpine
|
||||
|
||||
ENV PATH="/root/.composer/vendor/bin:${PATH}" \
|
||||
COMPOSER_ALLOW_SUPERUSER=1
|
||||
|
||||
RUN echo '#!/bin/sh' > /usr/local/bin/apk-install \
|
||||
&& echo 'apk add --update "$@" && rm -rf /var/cache/apk/*' >> /usr/local/bin/apk-install \
|
||||
&& chmod +x /usr/local/bin/apk-install
|
||||
|
||||
RUN echo 'http://dl-4.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories \
|
||||
&& apk update \
|
||||
&& apk-install \
|
||||
git \
|
||||
curl \
|
||||
curl-dev \
|
||||
libcurl \
|
||||
zlib-dev \
|
||||
freetype-dev \
|
||||
jpeg-dev \
|
||||
libjpeg-turbo-dev \
|
||||
postgresql-dev \
|
||||
libmcrypt-dev \
|
||||
libpng-dev \
|
||||
icu-dev \
|
||||
gettext-dev \
|
||||
vim \
|
||||
libxml2-dev \
|
||||
freetype-dev \
|
||||
unzip \
|
||||
libc6-compat \
|
||||
openssl \
|
||||
gcc \
|
||||
autoconf
|
||||
|
||||
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
|
||||
|
||||
# Install useful extensions
|
||||
RUN docker-php-ext-install \
|
||||
opcache \
|
||||
bcmath \
|
||||
ctype \
|
||||
curl \
|
||||
dom \
|
||||
iconv \
|
||||
fileinfo \
|
||||
gd \
|
||||
gettext \
|
||||
intl \
|
||||
json \
|
||||
mcrypt \
|
||||
mysqli \
|
||||
pgsql \
|
||||
pcntl \
|
||||
pdo \
|
||||
ftp \
|
||||
pdo_mysql \
|
||||
pdo_pgsql \
|
||||
phar \
|
||||
simplexml \
|
||||
xmlrpc \
|
||||
zip
|
||||
|
||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||
|
||||
COPY . /app
|
||||
WORKDIR /app
|
||||
|
||||
RUN composer install
|
||||
|
||||
EXPOSE 8888
|
||||
|
||||
ENTRYPOINT ["php"]
|
||||
CMD ["-S","0.0.0.0:8888","index.php"]
|
||||
Reference in New Issue
Block a user