dockerfile-node
dockerfile-node copied to clipboard
Support adding instructions at the start of the stage
Use case: I'd like to add certain files before running the build or install.
I have an analogous feature in dockerfile-rails: https://github.com/fly-apps/dockerfile-rails#advanced-customization (`--instructions), which would be relatively straightforward to port to this package.
More precise feedback on where exactly the instructions would be placed would be helpful. You can look at the dockerfile rails template to get an idea of what is implemented there:
- base is added to the end of the base step
- build is added just after the
COPY . .statement - deploy is added just after the
COPY --from-buildstatement (and the rails user is created, which does not currently apply in dockerfile-node).
Would this work for you?
Hmm so this use case was copying the .yarn folder (contains plugins) which needs to be copied before the yarn install command. I ended up ejecting because it was a bit too hard to maintain and also we went with Next.js's "standalone mode"
That use case seems common enough that it shouldn't require additional instructions. See this from dockerfile-rails:
https://github.com/fly-apps/dockerfile-rails/blob/b348b6962b928f64803ce0c3260c6eb98f5a8cb0/lib/generators/templates/_npm_install.erb#L3-L5
I assume that you have a .yarnrc? And what directories should be copied from the .yarn directory?