fp/strapi.dockerfile

22 lines
633 B
Plaintext
Raw Normal View History

2024-04-08 22:15:48 +00:00
FROM node:18.16-alpine
2024-04-08 21:33:49 +00:00
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
2024-04-08 22:15:48 +00:00
ENV NODE_ENV=production
2024-04-02 14:49:33 +00:00
RUN corepack enable
# Installing libvips-dev for sharp Compatibility
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-02 14:49:33 +00:00
WORKDIR /app
2024-04-08 18:23:31 +00:00
COPY pnpm-lock.yaml package.json ./
2024-04-08 21:33:49 +00:00
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
2024-04-02 14:49:33 +00:00
COPY ./packages/strapi .
RUN chown -R node:node /app
USER node
2024-04-08 22:25:35 +00:00
RUN pnpm run build
2024-04-02 14:49:33 +00:00
2024-04-08 21:45:49 +00:00
# FROM builder AS dev
# ENV NODE_ENV=development
# CMD ["pnpm", "run", "dev"]
2024-04-02 14:49:33 +00:00
2024-04-08 22:15:48 +00:00
2024-04-08 18:23:31 +00:00
ENTRYPOINT ["pnpm"]
CMD ["run", "start"]