pgporada / wsu-base-site-docker

For Jenny and crew
5 stars 1 forks source link

Upgrade to PHPBrew v2.x when support for PHP 8.2+ is available #3

Open chrispelzer opened 1 year ago

chrispelzer commented 1 year ago

Waiting on support for PHP 8.2+ with PHPBrew v2.x https://github.com/phpbrew/phpbrew/issues/1345

Otherwise for now we use PHPBrew v1.28.0 which works without an issue.

nickdenardis commented 1 year ago

@chrispelzer @pgporada A few questions about PHPBrew in this Docker context.

  1. What problem is it solving in a container?
  2. What are the pros/cons of using it?
  3. What are the alternatives?
pgporada commented 1 year ago

@nickdenardis

Recapping some of what was discussed at Tony V's:

  1. Using phpbrew in the dockerfile (and thus the container) allows for an easier transition from non-containered to containered. As the PHP version changes in base, school of med, etc a rebuild of the docker container will install that updated PHP version. At a certain undetermined point phpbrew should be removed from each repository which leads into alternatives in #3.
  2. Installing php from source is incredibly slow, especially depending on the host CPU architecture performing the compilation. Not only does php have to be compiled, but openssl, and other extensions like gd and redis support. Pro: When building a container we can get any specific version of PHP needed by a project using phpbrew. Con: The speed of compilation. PHP version drift leading to proliferation of PHP container versions. You have to maintain the containers rather than relying on some upstream provider. The PHP org's oldest container is PHP 5.6.14 so anything older you'll probably need to build it.
  3. The primary alternative is that when containers for all the in-use versions of PHP are built, phpbrew should be removed from each repository. When PHP upgrades are needed, a container swap could happen. In docker terms that would look something like this:
    
    # Current container
    FROM pgporada/php:8.2.7
    CMD ["/php-fpm"]

New container

FROM pgporada/php:8.4.2 CMD ["/php-fpm"]


There's another alternative using something that @chrispelzer mentioned called [phpenv](https://github.com/phpenv/phpenv), but I think that software gets you about as far as phpbrew currently does. The goal should be one site per container using one specific version of PHP.
chrispelzer commented 1 year ago

I was thinking about using a private registry but our containers shouldn't have anything private in it so using dockerhub would be possible to host the containers, but I think we need to do it from a single waynestate account.

pgporada commented 1 year ago

I think we need to do it from a single waynestate account.

Agreed, and this repository should be transferred to WSU too. https://github.com/pgporada/wsu-base-site-docker/issues/5