Closed mnmkng closed 2 months ago
Few random thoughts:
npm install
inside the imageSo overall, why not, I just wouldn't expect it will solve much of our current problems, rather it will simplify things for users (which is always nice), but only for those that will go with the Apify CLI right ahead - for crawlee users that will try to deploy on the platform it won't change anything.
Yeah, in a way I agree with the comments. But I think we could have better insight into what's actually happening in our images if we were only copying source into them as the last step instead of doing the whole pre-install (in base dockers) + re-install (in userland) magic that we're doing now. Basically, we would control a larger part of the build process.
I see the problem, but I am afraid that by hiding this complexity, we get into very similar problems as we had with single file - i.e.
As a plus, I see that this way, we could have been able to limit the number of image variations and so the size of builds and increase the performance of workers.
I'd first consider more solutions to this - maybe we can somehow improve the images or bring better defaults?
Closing this for inactivity
I've been thinking about this for quite some time. Our Dockerfiles are becoming increasingly more complex. The last complexities come from multistage builds with TypeScript. There's always something to fix and it's an ever growing pain to manage.
Most of our actors use one of our predefined base images AND predefined Dockerfile templates. In most cases, users shouldn't need to change those at all. Issues like this or this happen repeatedly for years.
Proposal:
Allow specifying the runtime in actor.json instead of in Dockerfile. E.g.
Or, although I would not suggest this, but it could be useful for quickly running new projects.
This would detect the env based on presence of
package.json
or some Python files and then analyzing thepackage.json
for dependencies. Basically something like we had for single file, but instead of parsing code, it would parsepackage.json
.Possible benefits:
npm install
in most cases and we could just copy the source and be done with it.What do you think? @jancurn @mtrunkat @fnesveda @dragonraid @B4nan