-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build cache for yarn install command Remove unnecessary mkdir command
- Loading branch information
Showing
1 changed file
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
FROM node:16-alpine | ||
RUN mkdir -p /usr/src/app | ||
ENV APP_PATH /usr/src/app | ||
COPY package.json $APP_PATH | ||
WORKDIR $APP_PATH | ||
RUN yarn install | ||
COPY . $APP_PATH | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY yarn.lock package.json . | ||
|
||
RUN --mount=type=cache,target=/root/.yarn --mount=type=cache,target=/root/.cache YARN_CACHE_FOLDER=/root/.yarn yarn install | ||
|
||
COPY . . | ||
|
||
# expose port 3000 for server and 9000 for webpack-dev-server | ||
EXPOSE 3000 9000 | ||
|
||
# run start:frontend and start:dev in parallel | ||
CMD ["yarn", "start:frontend", "start:dev"] |