fp/dockerfiles/strapi.dockerfile

13 lines
486 B
Docker

FROM node:20 AS strapi
WORKDIR /usr/src/app/
RUN corepack enable && corepack prepare pnpm@9.6.0 --activate
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
COPY ./services/strapi/package.json ./services/strapi/pnpm-lock.yaml .
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm fetch
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile --prefer-offline
COPY ./services/strapi/ .
RUN ls -la .
RUN ["pnpm", "run", "build"]
CMD ["pnpm", "run", "develop"]