fp/strapi.dockerfile

34 lines
867 B
Plaintext
Raw Normal View History

2024-04-11 08:17:51 +00:00
FROM node:20-alpine as base
2024-04-08 23:52:57 +00:00
WORKDIR /app
2024-04-11 08:17:51 +00:00
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
2024-04-02 14:49:33 +00:00
RUN corepack enable
2024-04-08 18:23:31 +00:00
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev vips-dev libc6-compat git nasm bash gcompat
2024-04-11 08:17:51 +00:00
FROM base AS install
2024-04-09 07:00:38 +00:00
COPY ./packages/strapi/pnpm-lock.yaml ./packages/strapi/package.json ./
2024-04-12 19:25:44 +00:00
RUN pnpm install --prod --shamefully-hoist && pnpm run build
2024-04-09 07:00:38 +00:00
COPY ./packages/strapi .
RUN chown -R node:node /app
USER node
2024-04-11 08:17:51 +00:00
2024-04-12 19:25:44 +00:00
# FROM base AS install
# COPY ./packages/strapi/pnpm-lock.yaml ./
# RUN pnpm fetch --prod
# COPY ./packages/strapi .
# RUN pnpm i --offline --prod --shamefully-hoist && pnpm run build
# RUN chown -R node:node /app
# USER node
2024-04-11 08:17:51 +00:00
FROM install AS dev
ENV NODE_ENV=development
ENTRYPOINT ["pnpm"]
CMD ["run", "dev"]
FROM install AS release
ENV NODE_ENV=production
2024-04-09 07:00:38 +00:00
ENTRYPOINT ["pnpm"]
CMD ["run", "start"]