Optimize Dockerfile to Leverage Layer Caching and Improve Build Times (Backend) #66
Closed
2 tasks done
Labels
duplicate
This issue or pull request already exists
Is there an existing issue for this?
What happened?
The current Dockerfile in the project rebuilds from scratch every time there are changes in the source code, even when the dependencies or system-level packages haven't changed. This results in inefficient caching and unnecessarily long build times.
The main issues is the entire source code is copied early in the Dockerfile, which causes Docker to invalidate subsequent cached layers (e.g., dependency installation) whenever the code changes.
Record
The text was updated successfully, but these errors were encountered: