diff --git a/Dockerfile b/Dockerfile index 735e195..0ea586d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ No newline at end of file +RUN yarn install