hrms-edm/Services/Dockerfile
moss cbc7757353
Some checks failed
release / release (push) Failing after 10s
test
2025-04-10 09:41:25 +07:00

44 lines
1 KiB
Docker

# docker build -t docker.frappet.com/edm/core .
FROM node:23-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
ARG API_ENDPOINT="/api/"
WORKDIR /app
FROM base AS server
COPY ./server .
FROM server AS deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
FROM server AS build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build
FROM base AS client
COPY ./client .
ENV VITE_API_ENDPOINT="$API_ENDPOINT"
ENV VITE_KC_REALM="ENV_KC_REALM"
ENV VITE_KC_URL="ENV_KC_URL"
ENV VITE_CLIENTID_KEYCLOAK="ENV_CLIENTID_KEYCLOAK"
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build
FROM base AS prod
COPY --from=deps /app/node_modules /app/node_modules
COPY --from=build /app/dist /app/dist
COPY --from=server /app/static /app/static
COPY --from=client /app/dist /app/static
COPY ./entrypoint.sh ./entrypoint.sh
RUN chmod u+x ./entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]