Updated monorepo building, dockerized
This commit is contained in:
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
FROM node:20-slim AS builder
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
RUN corepack enable
|
||||
COPY . /app
|
||||
WORKDIR /app
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
||||
ARG VITE_WS_URL
|
||||
RUN pnpm run -r build
|
||||
|
||||
FROM builder as back_pruned
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm --filter back --prod deploy pruned
|
||||
|
||||
FROM nginx:alpine-slim as front
|
||||
WORKDIR /usr/share/nginx/html
|
||||
RUN rm -rf ./*
|
||||
COPY --from=builder /app/apps/front/dist .
|
||||
|
||||
FROM node:20-slim as back
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
COPY --from=back_pruned /app/pruned .
|
||||
CMD [ "npm", "start" ]
|
Reference in New Issue
Block a user