|
| 1 | +FROM alpine:edge |
| 2 | + |
| 3 | +ARG COMPOSER_HASH |
| 4 | +ARG DRUSH_VERSION |
| 5 | +ARG BUILD_DATE |
| 6 | +ARG VCS_REF |
| 7 | + |
| 8 | +LABEL org.label-schema.build-date=$BUILD_DATE \ |
| 9 | + org.label-schema.vcs-ref=$VCS_REF \ |
| 10 | + org.label-schema.schema-version="1.0" \ |
| 11 | + org.label-schema.name="docker-php" \ |
| 12 | + org.label-schema.description="PHP 8.4 Alpine for Drupal - git, composer, drush 8, sqlite, patch" \ |
| 13 | + org.label-schema.vcs-url="https://github.com/skilld-labs/docker-php" \ |
| 14 | + maintainer= "Andy Postnikov <[email protected]>" |
| 15 | + |
| 16 | +ENV PHPRUN_DEPS \ |
| 17 | + curl \ |
| 18 | + git \ |
| 19 | + make \ |
| 20 | + mariadb-client \ |
| 21 | + openssh-client \ |
| 22 | + patch \ |
| 23 | + rsync \ |
| 24 | + sqlite |
| 25 | +ENV PHP_CLI_SERVER_WORKERS 4 |
| 26 | + |
| 27 | +RUN set -e \ |
| 28 | + && apk --update upgrade \ |
| 29 | + && echo 'https://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories \ |
| 30 | + && apk add --upgrade \ |
| 31 | + php84 \ |
| 32 | + php84-pecl-apcu \ |
| 33 | + php84-pecl-brotli \ |
| 34 | + php84-pecl-igbinary \ |
| 35 | + php84-pecl-uploadprogress \ |
| 36 | + php84-pecl-xdebug \ |
| 37 | + php84-bcmath \ |
| 38 | + php84-ctype \ |
| 39 | + php84-curl \ |
| 40 | + php84-dom \ |
| 41 | + php84-fileinfo \ |
| 42 | + php84-gd \ |
| 43 | + php84-gmp \ |
| 44 | + php84-iconv \ |
| 45 | + php84-mbstring \ |
| 46 | + php84-opcache \ |
| 47 | + php84-openssl \ |
| 48 | + php84-pcntl \ |
| 49 | + php84-pdo_mysql \ |
| 50 | + php84-pdo_sqlite \ |
| 51 | + php84-phar \ |
| 52 | + php84-session \ |
| 53 | + php84-simplexml \ |
| 54 | + php84-sqlite3 \ |
| 55 | + php84-tokenizer \ |
| 56 | + php84-xml \ |
| 57 | + php84-xmlreader \ |
| 58 | + php84-xmlwriter \ |
| 59 | + php84-zip \ |
| 60 | + $PHPRUN_DEPS \ |
| 61 | + && ln -fs php84 /usr/bin/php \ |
| 62 | +# build extra extensions |
| 63 | +# && apk add --virtual .php-build \ |
| 64 | +# php84-dev php84-pear make gcc g++ \ |
| 65 | +# && sed -ie 's/-n//g' /usr/bin/pecl83 \ |
| 66 | +# && CFLAGS="-Os -fomit-frame-pointer -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fvisibility=hidden -Wall -Wno-strict-aliasing" \ |
| 67 | +# CPPFLAGS="$CFLAGS" LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" \ |
| 68 | +# pecl83 install redis \ |
| 69 | +# && echo 'extension=redis' > /etc/php84/conf.d/redis.ini \ |
| 70 | +# && echo 'xhprof.output_dir=/tmp' >> /etc/php84/conf.d/xhprof.ini \ |
| 71 | +# && strip /usr/lib/php84/modules/redis.so \ |
| 72 | +# && wget https://github.com/xdebug/xdebug/archive/master.zip && unzip master.zip && rm master.zip \ |
| 73 | +# && cd xdebug-master && phpize83 && ./configure --with-php-config=php-config83 \ |
| 74 | +# && CFLAGS="-Os -fomit-frame-pointer -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fvisibility=hidden -Wall -Wno-strict-aliasing" \ |
| 75 | +# CPPFLAGS="$CFLAGS" LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" \ |
| 76 | +# pecl83 install xdebug-3.0.0 \ |
| 77 | +# make install \ |
| 78 | +# && cd .. && rm -rf xdebug-master \ |
| 79 | +# && echo ';zend_extension=xdebug' > /etc/php84/conf.d/xdebug.ini \ |
| 80 | +# && strip /usr/lib/php84/modules/xdebug.so \ |
| 81 | +# clean-up |
| 82 | +# && apk del --no-network .php-build \ |
| 83 | +# && rm -fr /tmp/pear /usr/include /usr/share/pear \ |
| 84 | + && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ |
| 85 | + && php -r "if (hash_file('SHA384', 'composer-setup.php') === getenv('COMPOSER_HASH')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \ |
| 86 | + && php composer-setup.php \ |
| 87 | + --install-dir=/usr/bin \ |
| 88 | + --filename=composer2 \ |
| 89 | + --2 \ |
| 90 | + && ln -s composer2 /usr/bin/composer \ |
| 91 | + && php -r "unlink('composer-setup.php');" \ |
| 92 | +# && php -r "copy('https://github.com/drush-ops/drush/releases/download/$DRUSH_VERSION/drush.phar', '/usr/bin/drush');" \ |
| 93 | +# && chmod +x /usr/bin/drush && /usr/bin/drush version && rm -fr /root/.drush \ |
| 94 | + && rm -fr /var/cache/apk/* |
| 95 | + |
| 96 | +COPY --chmod=0755 drush.phar /usr/bin/drush |
| 97 | + |
| 98 | +COPY php.ini /etc/php84/conf.d/xx-drupal.ini |
| 99 | + |
| 100 | +WORKDIR /srv |
| 101 | + |
| 102 | +CMD ["php", "-t", "/srv", "-S", "0.0.0.0:80"] |
0 commit comments