src-d / sourced-ui

source{d} UI
https://sourced.tech
Apache License 2.0
7 stars 15 forks source link

[idea] Different docker images for prod and dev #273

Closed se7entyse7en closed 5 years ago

se7entyse7en commented 5 years ago

Related to #272.

This actually a more general issue that includes #272.

The current Dockerfile installs a lot of things that are actually not needed to just run the service. I don't know the impact, but most probably we can reduce the total size of the image considerably.

Among these there's also nodejs that is needed to compile the static files. In case of a prod docker image, would it be possible to use a multi-stage build so that in the final image we only have the required compiled static files?

smacker commented 5 years ago

It's possible to pass env variables to docker build which would allow us to use the same Dockerfile but build different versions with and without dev deps depends on the variable.