Skip to content

Commit

Permalink
build: updated Dockerfile to use corepack
Browse files Browse the repository at this point in the history
- cleaned up/optimized command execution
  • Loading branch information
TyIsI committed Sep 30, 2024
1 parent 482ae7c commit b4e3f54
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions Dockerfile
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

0 comments on commit b4e3f54

Please sign in to comment.