mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[GH-ISSUE #339] Separate layers in dockerfile to improve image build #125
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#125
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vitorcx on GitHub (Nov 26, 2019).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/339
Originally assigned to: @vitorcx on GitHub.
Is your feature request related to a problem? Please describe.
The problem is related to the efficiency in the nodejs image building process when we choose to develop/contribute using docker-compose.
I realized that in the current dockerfile there is only one layer responsible for copying all code from the current directory into the container. This results in the need to rebuild the image from this layer whenever any part of the code is changed, which can lead to unnecessary waiting for the
npm installprocess in cases where dependencies have not changed.Describe the solution you'd like
One possible way to solve this is to separate the layers where the source code and package.json / package-lock.json are copied into the container. Also, copy the remaining source code only after the
npm installprocess. Thus the dependencies will only be reinstalled when new dependencies are changed / added.Describe alternatives you've considered
Another possibility of improvement is the addition of a docker-compose volume containing the source code, this would allow behavior similar to a hot reloading.
Additional context
Of course, all these suggestions made here are subject to discussion, because I may not be fully aware of the reasons why they are not currently implemented, even though they seems to be simple.
@liyasthomas commented on GitHub (Nov 26, 2019):
Because I'm a Docker noob. I'm new to Docker and all it's functionalities. It would be great if you could shoot up a PR! I'm still learning Docker, I'll review and merge to master 👍
@vitorcx commented on GitHub (Nov 26, 2019):
Thanks for replying, i will do it then! It will be a pleasure to help.
@liyasthomas commented on GitHub (Nov 26, 2019):
#340 solves this hence closing