lib/generators/templates/_install_node.erb in dockerfile-rails-1.5.8 vs lib/generators/templates/_install_node.erb in dockerfile-rails-1.5.9
- old
+ new
@@ -1,32 +1,32 @@
+<% if using_bun? -%>
+# Install Bun
+<% if bun_version -%>
+ARG BUN_VERSION=<%= bun_version %>
+<% end -%>
+ENV BUN_INSTALL=/usr/local/bun
+ENV PATH=/usr/local/bun/bin:$PATH
+RUN curl -fsSL https://bun.sh/install | bash<% if bun_version %> -s -- "bun-v${BUN_VERSION}"<% end %>
+<% else -%>
<% if node_version and yarn_version -%>
# Install JavaScript dependencies
<% elsif node_version -%>
# Install Node.js
<% elsif yarn_version -%>
# Install yarn
<% end -%>
<% if node_version && node_version != 'lts' -%>
ARG NODE_VERSION=<%= node_version %>
<% end -%>
-<% if using_bun? -%>
-<% if bun_version -%>
-ARG BUN_VERSION=<%= bun_version %>
-<% end -%>
-<% else -%>
<% if yarn_version -%>
ARG YARN_VERSION=<%= yarn_version %>
<% end -%>
-<% end -%>
<% if node_version && node_version != 'lts' -%>
ENV PATH=/usr/local/node/bin:$PATH
RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz -C /tmp/ && \
/tmp/node-build-master/bin/node-build "${NODE_VERSION}" /usr/local/node && \
<% end -%>
-<% if using_bun? -%>
- npm install -g bun<% if bun_version %>@$BUN_VERSION<% end %> && \
-<% else -%>
<% if yarn_version -%>
<% if yarn_version < '2' -%>
<% if node_version -%> <% else %>RUN<% end %> npm install -g yarn@$YARN_VERSION<% if node_version -%> && \<% end %>
<% else -%>
<% if node_version && (node_version.split('.').map(&:to_i) <=> [16,10,0]) < 0 -%>
@@ -35,9 +35,9 @@
corepack enable && \
<% end -%>
corepack prepare yarn@$YARN_VERSION --activate<% if node_version -%> && \<% end %>
<% end -%>
<% end -%>
-<% end -%>
<% if node_version -%>
rm -rf /tmp/node-build-master
+<% end -%>
<% end -%>