Skip to content

Commit 8fb7ae5

Browse files
committed
fix: adjust Dockerfile for new node_modules locations
1 parent 9db5825 commit 8fb7ae5

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@ RUN chown node "/usr/local/src/reaction-app"
6464
RUN chown node "/usr/local/src/reaction-app/node_modules"
6565
RUN chown node "/usr/local/src/reaction-app/package/node_modules"
6666

67-
WORKDIR $APP_SOURCE_DIR/..
68-
COPY --chown=node package.json yarn.lock $APP_SOURCE_DIR/../
67+
WORKDIR $APP_SOURCE_DIR
68+
69+
# Note that the two node_modules directories will not be copied during
70+
# this due to being listed in the `.dockerignore` file.
71+
COPY --chown=node . $APP_SOURCE_DIR
6972

7073
# Build the dependencies into the Docker image in a cacheable way. Dependencies
7174
# are only rebuilt when package.json or yarn.lock is modified.
@@ -92,8 +95,7 @@ RUN set -ex; \
9295
--frozen-lockfile \
9396
--ignore-scripts \
9497
--no-cache; \
95-
fi; \
96-
rm package.json yarn.lock
98+
fi;
9799

98100
# For development, we will yarn install on each container start.
99101
# This ensures that we use our Docker development .yarnrc config
@@ -107,9 +109,6 @@ RUN set -ex; \
107109
# we already ran yarn install above, it doesn't matter.
108110
COPY --chown=node ./.reaction/yarnrc-docker.template /home/node/.yarnrc
109111

110-
WORKDIR $APP_SOURCE_DIR
111-
COPY --chown=node . $APP_SOURCE_DIR
112-
113112
# Important: Make sure we're the "node" user before we begin doing things because
114113
# our tools use "/home/node" as the HOME dir.
115114
USER node

0 commit comments

Comments
 (0)