24 lines
487 B
Docker
24 lines
487 B
Docker
FROM node:23-alpine AS base
|
|
ENV PNPM_HOME="/pnpm"
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
|
|
FROM base AS build
|
|
WORKDIR /app
|
|
COPY . /app
|
|
|
|
RUN corepack enable
|
|
RUN apk add --no-cache python3 alpine-sdk
|
|
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
|
pnpm install --prod --frozen-lockfile
|
|
|
|
RUN pnpm deploy --filter=@imput/cobalt-api --prod /prod/api
|
|
|
|
FROM base AS api
|
|
WORKDIR /app
|
|
|
|
COPY --from=build /prod/api /app
|
|
COPY --from=build /app/.git /app/.git
|
|
|
|
EXPOSE 9000
|
|
CMD [ "node", "src/cobalt" ]
|