devlikeapro / waha

WAHA - WhatsApp HTTP API (REST API) that you can configure in a click! Two engines: chromium-based WEBJS and pure-websocket NOWEB
https://waha.devlike.pro/
Apache License 2.0
878 stars 273 forks source link

Reduce the docker image #153

Open sunilsankar opened 1 year ago

sunilsankar commented 1 year ago

Hi is it possible to reduce the docker image size. I see that it is 1.92GB for arm .Can we use alpine image instead of bullseye and also reducing the number of layers make the image small. Better to have different images for noweb and webjs. Just a suggestion . Awesome project btw :)

REPOSITORY                      TAG       IMAGE ID       CREATED       SIZE
devlikeapro/whatsapp-http-api   arm       40ff15031379   11 days ago   1.92GB
ksingh7 commented 1 year ago

+1 @sunilsankar @allburov Using scratch or alpine + using docker-slim to further squeeze the image size.

allburov commented 1 year ago

Hi! Great idea, I'm facing the problem with the image size while using 3G mobile internet :D

I'd love to keep the original and latest image as debian based and "all inclusive" tho. For the start we could create these images (it'll reduce about 500MB memory that chromium uses)

In the next step we could try to use alpine (I'm skeptical about docker-slim...) and create a bit more images

8 images... If there's anyone who could contribute to the project so we can have 2 Dockerfiles for that Dockerfile and Dockerfile.alpine - it'd be great :pray:

I'd start with the first step - separating chrome\no-chrome builds For "with chromium" and "no chromium" we could use multi stage builds so we don't have to maintain 4 Dockerfiles and keep them in sync...

sunilsankar commented 1 year ago

I will try to contribute @allburov

allburov commented 9 months ago

Hi! I've added 3 different images - default with chromium, with chrome and no browser (for NOWEB engine) https://waha.devlike.pro/docs/how-to/engines/#docker-images

devlikeapro/whatsapp-http-api                                  noweb              1.49GB
devlikeapro/whatsapp-http-api                                  chrome             2GB
devlikeapro/whatsapp-http-api                                  latest             2.05GB

It shouldn't be hard to extend it with alpine or similar small base image using github matrix https://github.com/devlikeapro/whatsapp-http-api/blob/core/.github/workflows/build.yaml

The tags should be start with alpine in this way

Contributions are welcome!