-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: updated Dockerfile to use corepack
- cleaned up/optimized command execution
- Loading branch information
Showing
1 changed file
with
12 additions
and
14 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,29 +1,27 @@ | ||
FROM node:lts AS build | ||
|
||
WORKDIR /build | ||
FROM node:lts AS base | ||
|
||
RUN corepack enable | ||
|
||
RUN npm install -g npm | ||
FROM base AS build | ||
|
||
COPY package.json . | ||
COPY yarn.lock . | ||
WORKDIR /build | ||
|
||
COPY client/ client/ | ||
COPY server/ server/ | ||
COPY package.json yarn.lock /build/ | ||
|
||
RUN npx yarn install | ||
COPY client/ /build/client/ | ||
COPY server/ /build/server/ | ||
|
||
RUN npx yarn workspace tacos-client run build | ||
RUN yarn install && yarn workspace tacos-client run build | ||
|
||
FROM node:lts | ||
FROM base AS prod | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["npm","start"] | ||
WORKDIR /app | ||
|
||
RUN npm install -g npm | ||
WORKDIR /app | ||
|
||
COPY --from=build /build/server/ /app/ | ||
COPY --from=build /build/client/build/ /app/public/ | ||
|
||
RUN npx yarn install | ||
RUN yarn install |