Skip to content

Commit 43fa93c

Browse files
author
James Hart
committed
Base image now includes yarn, so no need to install it during assignment 11
1 parent 73283af commit 43fa93c

File tree

1 file changed

+3
-28
lines changed

1 file changed

+3
-28
lines changed

_assignments/assignment_11.md

+3-28
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,7 @@ Now run the `webpacker:install` rails rake task.
2020
docker-compose run --rm app bundle exec rails webpacker:install
2121
```
2222

23-
> **Note**: You should see an error message. This is expected!\_
24-
25-
Looks like yarn is not installed! Let's install yarn by changing the `Dockerfile`
26-
27-
```
28-
RUN apk add --update --no-cache \
29-
bash \
30-
build-base \
31-
nodejs \
32-
sqlite-dev \
33-
tzdata \
34-
postgresql-dev \
35-
yarn
36-
```
37-
38-
And now you'll need to rebuild the app container
39-
40-
```
41-
docker-compose build app
42-
```
43-
44-
We can rerun the `webpacker:install` task now that yarn is installed.
45-
46-
```
47-
docker-compose run --rm app bundle exec rails webpacker:install
48-
```
23+
> **Note**: We have already added yarn to the Docker image – normally you would need to add yarn as a dependency prior to this step.
4924
5025
If you run a `git status`, You'll see quite a few files were created and then `yarn install` was run.
5126

@@ -90,7 +65,7 @@ Let’s try booting up the server again.
9065
docker-compose up app
9166
```
9267

93-
> **Note**: We’ll see another error. It’s because we removed the node*modules directory – now that we have a volume mounted let’s install those again.*
68+
> **Note**: We’ll see another error. It’s because we removed the node\_modules directory – now that we have a volume mounted let’s install those again.*
9469
9570
```
9671
docker-compose run --rm app yarn install
@@ -102,7 +77,7 @@ And let’s boot the server up again.
10277
docker-compose up app
10378
```
10479

105-
And also notice on your local disk, the `node_modules` directory exists but it is empty!
80+
And also notice on your local disk, the `node_modules` directory exists but now it is empty!
10681

10782
Okay! We also need to revisit the `Dockerfile` to run `yarn install` so that if other engineers on your team pull the app they don’t run into the same yarn install error we just saw.
10883

0 commit comments

Comments
 (0)