phplist-docker icon indicating copy to clipboard operation
phplist-docker copied to clipboard

start with alpine to reduce the image size

Open michield opened this issue 4 years ago • 6 comments

See also https://mantis.phplist.org/view.php?id=20318

It would be nice to start from alpine, as that will presumably reduce the overall image size.

michield avatar Jan 13 '21 11:01 michield

@michield , as requested, here is a first version of the phplist alpine based image. I am not creating a PR for now as the format is really different from what you propose in your base image.

I would prefer that we iterate through this issue and converge on something workable for you before submitting a PR.

Here is the necessary to build the image itself:

phplist-alpine.zip

To ensure the mail part is working you need to have a mail server available and define the following variables (in docker-compose env file for example):

PHPLIST_PHPMAILERHOST=smtp.domain.com
PHPLIST_PHPMAILERPORT=587
PHPLIST_PHPMAILER_SECURE=tls
[email protected]
PHPLIST_PHPMAILER_SMTPPASSWORD=your_mail_at_domain.com_passsword
[email protected]
PHPLIST_BOUNCE_MAILBOX_HOST=imap.domain.com
PHPLIST_BOUNCE_MAILBOX_PORT=993/imap/ssl/novalidate-cert

Of course the docker-compose file should contain a MariaDB and Apache/NGINX server. I have a production working environment but it also relies on traefik as the frontend, so probably more complex to adapt if we want NGINX to be the frontend.

Any comment/suggestion is welcome so that I rework this to make it compatible to your needs. I guess you might have also some advice to improve the image (it is certainly not perfect as it is).

doc75 avatar Jan 24 '21 14:01 doc75

Thanks, I've branched to https://github.com/phpList/phplist-docker/tree/from_alpine with your version, so we can work on it from there. Are you familiar with the Github forking and PR processes? That's the easiest way to contribute.

michield avatar Jan 28 '21 16:01 michield

@michield , Yes I know how to contribute. This is great that you setup a specific branch. I'll see how I can fit in this. Any guidelines on your side ?

doc75 avatar Jan 28 '21 18:01 doc75

No, I'd say, fork it, work on it to make it do what you want to achieve and when you're done and think it's worth merging, we can have a look. We may need to work to handle the different environment variables, but that's fairly trivial.

Your image is 174MB on my system, and mine is 472MB, so it's a great improvement

michield avatar Jan 28 '21 19:01 michield

FWIW I am working on running phpList on Alpine in a Docker container for production use behind an nginx reverse proxy. I'm playing around with this at https://github.com/bfranske/phplist-alpine/ but don't know how far I'll get how quickly.

bfranske avatar Jan 18 '24 02:01 bfranske

Be aware that phpList is not so great at "URL detection" when behind proxies. I'm trying to work on this here https://github.com/phpList/phplist3/pull/914

michield avatar Jan 20 '24 16:01 michield