From efcc7ebb32fda14b9ec06da35f1f42b130704322 Mon Sep 17 00:00:00 2001 From: Vijay Soni Date: Mon, 7 Oct 2024 01:04:44 +0530 Subject: [PATCH] Add frontend build stage to Dockerfile Add a stage for building the frontend web app in the Dockerfile. --- Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e933c4682..d5208c6b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,11 +15,19 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store \ RUN pnpm deploy --filter=@imput/cobalt-api --prod /prod/api +FROM base AS frontend +WORKDIR /app/web +COPY web /app/web + +RUN pnpm install --frozen-lockfile +RUN pnpm run build + FROM base AS api WORKDIR /app COPY --from=build /prod/api /app COPY --from=build /app/.git /app/.git +COPY --from=frontend /app/web/build /app/public EXPOSE 9000 -CMD [ "node", "src/cobalt" ] \ No newline at end of file +CMD [ "node", "src/cobalt" ]