2024-11-02 17:23:31 +01:00
|
|
|
FROM node:23-alpine AS base
|
2024-08-03 18:12:29 +02:00
|
|
|
ENV PNPM_HOME="/pnpm"
|
|
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
|
|
|
|
|
|
FROM base AS build
|
2023-02-20 20:12:26 +01:00
|
|
|
WORKDIR /app
|
2024-08-03 18:12:29 +02:00
|
|
|
COPY . /app
|
|
|
|
|
|
|
|
RUN corepack enable
|
2024-11-02 17:23:31 +01:00
|
|
|
RUN apk add --no-cache python3 alpine-sdk
|
2024-08-03 18:12:29 +02:00
|
|
|
|
|
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
|
|
|
pnpm install --prod --frozen-lockfile
|
2023-04-09 07:38:37 +02:00
|
|
|
|
2024-08-03 18:12:29 +02:00
|
|
|
RUN pnpm deploy --filter=@imput/cobalt-api --prod /prod/api
|
|
|
|
|
|
|
|
FROM base AS api
|
|
|
|
WORKDIR /app
|
2023-04-09 07:38:37 +02:00
|
|
|
|
2024-11-19 15:20:12 +01:00
|
|
|
COPY --from=build --chown=node:node /prod/api /app
|
|
|
|
COPY --from=build --chown=node:node /app/.git /app/.git
|
|
|
|
|
|
|
|
USER node
|
2023-04-09 07:38:37 +02:00
|
|
|
|
2023-02-20 20:12:26 +01:00
|
|
|
EXPOSE 9000
|
2024-11-01 18:52:46 +01:00
|
|
|
CMD [ "node", "src/cobalt" ]
|