24 lines
638 B
Plaintext
24 lines
638 B
Plaintext
|
FROM node:20-alpine as base
|
||
|
WORKDIR /app
|
||
|
ENV PNPM_HOME="/pnpm"
|
||
|
ENV PATH="$PNPM_HOME:$PATH"
|
||
|
RUN corepack enable
|
||
|
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev vips-dev libc6-compat git nasm bash gcompat
|
||
|
|
||
|
FROM base AS install
|
||
|
COPY ./packages/strapi/pnpm-lock.yaml ./packages/strapi/package.json ./
|
||
|
RUN pnpm install --prod --shamefully-hoist && pnpm run build
|
||
|
COPY ./packages/strapi .
|
||
|
RUN chown -R node:node /app
|
||
|
USER node
|
||
|
|
||
|
|
||
|
FROM install AS dev
|
||
|
ENV NODE_ENV=development
|
||
|
ENTRYPOINT ["pnpm"]
|
||
|
CMD ["run", "dev"]
|
||
|
|
||
|
FROM install AS release
|
||
|
ENV NODE_ENV=production
|
||
|
ENTRYPOINT ["pnpm"]
|
||
|
CMD ["run", "start"]
|