2024-11-01 17:52:46 +00:00
|
|
|
FROM node:23-bullseye-slim AS base
|
2024-08-03 16:12:29 +00:00
|
|
|
ENV PNPM_HOME="/pnpm"
|
|
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
|
|
|
|
|
|
FROM base AS build
|
2023-02-20 19:12:26 +00:00
|
|
|
WORKDIR /app
|
2024-08-03 16:12:29 +00:00
|
|
|
COPY . /app
|
|
|
|
|
|
|
|
RUN corepack enable
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y python3 build-essential
|
|
|
|
|
|
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
|
|
|
pnpm install --prod --frozen-lockfile
|
2023-04-09 05:38:37 +00:00
|
|
|
|
2024-08-03 16:12:29 +00:00
|
|
|
RUN pnpm deploy --filter=@imput/cobalt-api --prod /prod/api
|
|
|
|
|
|
|
|
FROM base AS api
|
|
|
|
WORKDIR /app
|
2023-04-09 05:38:37 +00:00
|
|
|
|
2024-08-03 16:12:29 +00:00
|
|
|
COPY --from=build /prod/api /app
|
|
|
|
COPY --from=build /app/.git /app/.git
|
2023-04-09 05:38:37 +00:00
|
|
|
|
2023-02-20 19:12:26 +00:00
|
|
|
EXPOSE 9000
|
2024-11-01 17:52:46 +00:00
|
|
|
CMD [ "node", "src/cobalt" ]
|