fp/dockerfiles/strapi.dockerfile

16 lines
592 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"
# ENV NODE_EXTRA_CA_CERTS ${NODE_EXTRA_CA_CERTS}
# COPY ./certs ./certs
# RUN ls -la /usr/src/app/certs
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"]