Docker icon indicating copy to clipboard operation
Docker copied to clipboard

RFC: use upstream PHP base image

Open J0WI opened this issue 5 years ago • 7 comments

I propose to use the PHP image of the docker library: https://hub.docker.com/_/php

As a first step, this PR keeps the current concept with nginx and supervisor running the same container. I'd also like to introduce some best practices for writing Dockerfiles. My goal is to get rid of supervisor completely and providing a pure FPM variant and a variant using php-apache as an alternative. This concept is inspired by other well known PHP images like Wordpress, Drupal, Joomla, Nextcloud, Matomo etc. They all run and scale pretty well in production.

You can find more information about the docker library and how to become an "official image" yourself here:

  • https://github.com/docker-library/official-images#contributing-to-the-standard-library
  • https://github.com/docker-library/faq#frequently-asked-questions

Please let me know how you think about it and if I should continue with this. Feel free to reach out if you have any questions.

J0WI avatar Jul 06 '19 23:07 J0WI

Thanks for opening this and getting it started. I have had a similar idea for quite some time now to attempt to simplify / use more "off the shelf" components, so this is a welcome proposal.

I am interested to see if there are any comments from the greater CachetHQ community on this one, I'm not sure if there are any strong preferences either way :)

djdefi avatar Jul 07 '19 02:07 djdefi

No further comments so far. How should I proceed with this?

J0WI avatar Jul 23 '19 23:07 J0WI

@J0WI Sorry for the long delay in responding.

It seems like this would be a welcome change and refresh, if you are still interested. As you may have noticed, the myself and the other current maintainers of this docker image are not super active here.

djdefi avatar Dec 04 '19 19:12 djdefi

For me it appears useful to ditch nginx and supervisor from this image completely, and rather integrate nginx with a dedicated nginx.conf through docker compose.

This also allows to keep up to date with newer Nginx versions more easily.

Examples can be taken from

  • https://lab.libreho.st/libre.sh/compose/wordpress
  • https://lab.libreho.st/libre.sh/compose/wordpress

Then the examples could also note how to configure the queue, a suiting database (Redis, Memcached, ...) and how to run workers in a separate container.

almereyda avatar Mar 30 '20 01:03 almereyda

Agreed. But this would result in a whole rewrite of the Dockerfile and break everything. I wanted to start with this part first. If you prefer to do the rewrite in a single step I can push all changes to this PR.

J0WI avatar Mar 30 '20 14:03 J0WI

I believe the current test failure is due to a missing mysql-client package for the MySQL DB tests.

djdefi avatar Apr 01 '20 05:04 djdefi

@djdefi thanks for the hint, all tests are now passing.

J0WI avatar Apr 07 '20 22:04 J0WI