21 lines
431 B
Docker
21 lines
431 B
Docker
# Reference-- https://pnpm.io/docker
|
|
|
|
FROM node:20-alpine AS base
|
|
ENV PNPM_HOME="/pnpm"
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
RUN corepack enable
|
|
WORKDIR /app
|
|
COPY ./package.json /app
|
|
EXPOSE 3939
|
|
|
|
FROM base AS dev
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install
|
|
CMD ["pnpm", "run", "dev"]
|
|
|
|
FROM base
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod
|
|
COPY ./index.js /app
|
|
ENTRYPOINT ["pnpm"]
|
|
CMD ["start"]
|
|
|