File tree Expand file tree Collapse file tree 3 files changed +17
-11
lines changed
Expand file tree Collapse file tree 3 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,15 @@ FROM prebuild AS <% if using_bun? %>bun<% else %>node<% end %>
7171
7272<% end -%>
7373<% if using_bun? and ( !using_execjs? || File . exist? ( 'bun.lockb' ) || File . exist? ( 'bun.lock' ) ) -%>
74+ <% if bun_version -%>
75+ ARG BUN_VERSION=<%= bun_version %>
76+ <% end -%>
77+ <% if options . alpine? -%>
78+ FROM oven/bun:<%= bun_version ? '${BUN_VERSION}' : '1' %> -alpine AS bun
79+ <% else -%>
80+ FROM oven/bun:<%= bun_version ? '${BUN_VERSION}' : '1' %> -debian AS bun
81+ <% end -%>
82+
7483<%= render partial : 'install_node' , locals : { bun_version : using_execjs? ? nil : bun_version } %>
7584
7685<% elsif using_node? and ( !using_execjs? || File . exist? ( 'yarn.lock' ) ) -%>
Original file line number Diff line number Diff line change 11<% if using_bun? -%>
2- # Install Bun
3- <% if bun_version -%>
4- ARG BUN_VERSION=<%= bun_version %>
5- <% end -%>
6- ENV BUN_INSTALL=/usr/local/bun
7- ENV PATH=/usr/local/bun/bin:$PATH
8- RUN curl -fsSL https://bun.sh/install | bash<% if bun_version %> -s -- "bun-v${BUN_VERSION}"<% end %>
2+ # Copy Bun from official image
3+ COPY --from=bun /usr/local/bin/bun /usr/local/bin/bun
4+ ENV PATH=/usr/local/bin:$PATH
95<% else -%>
106<% if node_version and yarn_version -%>
117# Install JavaScript dependencies
Original file line number Diff line number Diff line change @@ -38,11 +38,12 @@ RUN apt-get update -qq && \
3838 apt-get install --no-install-recommends -y build-essential libyaml-dev pkg-config unzip && \
3939 rm -rf /var/lib/apt/lists /var/cache/apt/archives
4040
41- # Install Bun
4241ARG BUN_VERSION=xxx
43- ENV BUN_INSTALL=/usr/local/bun
44- ENV PATH=/usr/local/bun/bin:$PATH
45- RUN curl -fsSL https://bun.sh/install | bash -s -- "bun-v${BUN_VERSION}"
42+ FROM oven/bun:${BUN_VERSION}-debian AS bun
43+
44+ # Copy Bun from official image
45+ COPY --from=bun /usr/local/bin/bun /usr/local/bin/bun
46+ ENV PATH=/usr/local/bin:$PATH
4647
4748# Install application gems
4849COPY Gemfile Gemfile.lock ./
You can’t perform that action at this time.
0 commit comments