php-spx icon indicating copy to clipboard operation
php-spx copied to clipboard

Added docker build scripts for alpine and ubuntu

Open 8ctopus opened this issue 5 years ago • 5 comments
trafficstars

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.

8ctopus avatar Nov 16 '20 04:11 8ctopus

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:

  • binaries should be automatically built for each pushed tag
  • binaries should be best stored as release assets
  • build matrix should also include the PHP version's dimension
  • Web UI files should be distributed alongside the binary
  • and what about going a step further by generating rpm & deb packages ?

NoiseByNorthwest avatar Nov 17 '20 21:11 NoiseByNorthwest

  1. and 2. maybe Github actions? what do you think?
  2. and 4. are easy.
  3. I have no packaging experience, do you?

8ctopus avatar Nov 18 '20 04:11 8ctopus

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

NoiseByNorthwest avatar Nov 18 '20 22:11 NoiseByNorthwest

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

kandy avatar Apr 13 '21 17:04 kandy

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

krokyze avatar Dec 01 '23 14:12 krokyze