sourceboat / docker-laravel

A highly opinionated docker image which aims to be perfectly suited to run our Laravel applications.
MIT License
10 stars 2 forks source link

Discussion: Split into 2 images #61

Open NeroAzure opened 3 years ago

NeroAzure commented 3 years ago

To split the image into two images (dev and prod) would be beneficial to the size of a production level image. Together with the proposed changes from #60 the prod version of this image would have less than 150MB.

The split would include a multistage dockerfile, where things like nodejs, npm, composer, yarn, etc would only be installed in the dev stage, which can later be used for development and as intermediary stage to build dependencies for the production image.

As names I propose:

NeroAzure commented 3 years ago

Maybe we could ommit the docker- prefix, as it is already implied by the fact that it is a docker image. Then the full names would be as follows:

In my opinion sourceboat/laravel would be quite fitting and most elegant for a production ready image.

NeroAzure commented 3 years ago

Other possibility would be to determine the image type by tag:

Pro: The image would not be split into two docker repositories Con: The tag naming could be ambiguous

The naming of the development image would be rather unfortunate in my opinion as the -dev suffix could be interpreted such that it is the pre-realease image for that version. The term builder would not be as fitting, as that one would not only be intended for building the assets, but also for active development.