fp/packages/link2cid/Dockerfile

21 lines
431 B
Docker
Raw Normal View History

2024-03-14 07:30:49 +00:00
# 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"]