Sha256: 770478db58aefce47679a3254cbd9559b38746ec4479a72649a417901e2f11a0

Contents?: true

Size: 1.77 KB

Versions: 3

Compression:

Stored size: 1.77 KB

Contents

<% 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 yarn_version -%>
ARG YARN_VERSION=<%= yarn_version %>
<% end -%>
<% if node_version && node_version != 'lts' -%>
<% if options.alpine? -%>
RUN curl -sL https://unofficial-builds.nodejs.org/download/release/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64-musl.tar.gz | tar xz -C /tmp/ && \
    cp -rp /tmp/node-v${NODE_VERSION}-linux-x64-musl/* /usr/local/ && \
<% else -%>
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 -%>
<% end -%>
<% 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 -%>
    npm i -g corepack && \
<% else -%>
    corepack enable && \
<% end -%>
    corepack prepare yarn@$YARN_VERSION --activate<% if node_version -%> && \<% end %>
<% end -%>
<% end -%>
<% if node_version && node_version != 'lts' -%>
<% if options.alpine? -%>
    rm -rf /tmp/node-v${NODE_VERSION}-linux-x64-musl
<% else -%>
    rm -rf /tmp/node-build-master
<% end -%>
<% end -%>
<% end -%>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dockerfile-rails-1.6.2 lib/generators/templates/_install_node.erb
dockerfile-rails-1.6.1 lib/generators/templates/_install_node.erb
dockerfile-rails-1.6.0 lib/generators/templates/_install_node.erb