Skip to content

Commit 70cde72

Browse files
authored
Add bundle install and yarn install to Dockerfile
1 parent e22508c commit 70cde72

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.devcontainer/Dockerfile

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,27 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
1818

1919

2020
# [Optional] Uncomment this line to install additional gems.
21-
# RUN gem install <your-gem-names-here>
21+
# Add the Rails main Gemfile and install the gems. This means the gem install can be done
22+
# during build instead of on start. When a fork or branch has different gems, we still have an
23+
# advantage due to caching of the other gems.
24+
RUN mkdir -p /tmp/rails
25+
COPY Gemfile Gemfile.lock RAILS_VERSION rails.gemspec package.json yarn.lock /tmp/rails/
26+
COPY actioncable/actioncable.gemspec /tmp/rails/actioncable/
27+
COPY actionmailbox/actionmailbox.gemspec /tmp/rails/actionmailbox/
28+
COPY actionmailer/actionmailer.gemspec /tmp/rails/actionmailer/
29+
COPY actionpack/actionpack.gemspec /tmp/rails/actionpack/
30+
COPY actiontext/actiontext.gemspec /tmp/rails/actiontext/
31+
COPY actionview/actionview.gemspec /tmp/rails/actionview/
32+
COPY activejob/activejob.gemspec /tmp/rails/activejob/
33+
COPY activemodel/activemodel.gemspec /tmp/rails/activemodel/
34+
COPY activerecord/activerecord.gemspec /tmp/rails/activerecord/
35+
COPY activestorage/activestorage.gemspec /tmp/rails/activestorage/
36+
COPY activesupport/activesupport.gemspec /tmp/rails/activesupport/
37+
COPY railties/railties.gemspec /tmp/rails/railties/
38+
RUN cd /tmp/rails \
39+
&& bundle install \
40+
&& yarn install \
41+
&& rm -rf /tmp/rails
2242

2343
# [Optional] Uncomment this line to install global node packages.
2444
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

.devcontainer/devcontainer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"name": "Ruby",
55
"build": {
66
"dockerfile": "Dockerfile",
7+
"context": "..",
78
"args": {
89
// Update 'VARIANT' to pick a Ruby version: 3, 3.0, 2, 2.7, 2.6
910
"VARIANT": "3",

0 commit comments

Comments
 (0)