strapi-docker
strapi-docker copied to clipboard
Bundle node_modules inside Docker images
Feature request
Please describe your feature request
- [x] I have created my request on the Product Board before I submitted this issue
- [x] I have looked at all the other requests on the Product Board before I submitted this issue
Summary
Currently, starting a Strapi docker container for the first time takes several minutes due to the Npm install, and this dependency can lead to failed runs.
Why is it needed?
This dependency on the Npm registry has a few drawbacks:
- large startup time on first run
- breaking startup if an Npm package has been unpublished (unlikely to happen)
- breaking startup if the Npm registry is down
Suggested solution(s)
Package node_modules
with the Docker images published to DockerHub.
Related issue(s)/PR(s)
Building modues etc. on startup means also, that you need build tools in your container. So you end up with a production container, which hast gcc installed. See: https://github.com/strapi/strapi-docker/blob/master/base/alpine/Dockerfile#L4 From a security perspective this is a big no go.
Not sure whether your argument is in favor or against the issue.
In favour :)
The way it's done now is against container best practices.