NoiseByNorthwest / php-spx

A simple & straight-to-the-point PHP profiling extension with its built-in web UI
GNU General Public License v3.0
2.14k stars 83 forks source link

Added docker build scripts for alpine and ubuntu #151

Open 8ctopus opened 4 years ago

8ctopus commented 4 years ago

Hello Sylvain,

I've created spx.so build scripts using docker BUILDKIT for my personal use and maybe you'll find it an interesting addition to your project.

The idea is that it's not always convenient to use an existing machine to build SPX from source. Thanks to the build scripts, new users get a faster ride to use SPX as they just need to add spx.so, spx.ini and the assets to the server. I can update the readme if you're interested to merge the PR.

NoiseByNorthwest commented 4 years ago

Hi,

TBH I think it's a welcome improvement as distribution / installation is clearly a weak point. But regarding the way to do it I've the following requirements:

8ctopus commented 4 years ago
  1. and 2. maybe Github actions? what do you think?
  2. and 4. are easy.
  3. I have no packaging experience, do you?
NoiseByNorthwest commented 4 years ago

I've no experience with github actions, but since it is closely integrated with github (I however dont know how it simplifies things such as github API auth) it looks like a quite good default choice.

  • I have no packaging experience, do you?

It is fairly easy with https://github.com/jordansissel/fpm

kandy commented 3 years ago

I use this sample to install in my Dockerfile that based on official php image

RUN git clone https://github.com/NoiseByNorthwest/php-spx.git  \
    --depth 1  --single-branch --branch master /usr/src/php/ext/spx && \
  docker-php-ext-install -j$(nproc) spx
krokyze commented 1 year ago

I use this sample to install in my Dockerfile that based on official php image

RUN git clone https://github.com/NoiseByNorthwest/php-spx.git  \
    --depth 1  --single-branch --branch master /usr/src/php/ext/spx && \
  docker-php-ext-install -j$(nproc) spx

Thank you for these fine lines! For those seeking an example of a PHP FPM Alpine-based Dockerfile:

RUN apk add zlib-dev && git clone https://github.com/NoiseByNorthwest/php-spx.git --depth 1  --single-branch --branch master /usr/src/php/ext/spx && \
    install-php-extensions spx
RUN echo "spx.http_enabled=1" >> /usr/local/etc/php/conf.d/docker-php-ext-spx.ini && \
    echo "spx.http_key=dev" >> /usr/local/etc/php/conf.d/docker-php-ext-spx.ini && \
    echo "spx.http_ip_whitelist=*" >> /usr/local/etc/php/conf.d/docker-php-ext-spx.ini