26 lines
649 B
Docker
26 lines
649 B
Docker
FROM node:18.16-alpine as base
|
|
RUN corepack enable
|
|
# Installing libvips-dev for sharp Compatibility
|
|
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev nasm bash vips-dev
|
|
ARG NODE_ENV=development
|
|
ENV NODE_ENV=${NODE_ENV}
|
|
WORKDIR /app
|
|
|
|
|
|
FROM base AS build
|
|
COPY package.json pnpm-lock.yaml ./
|
|
# RUN yarn config set network-timeout 600000 -g && yarn install
|
|
RUN pnpm install --frozen-lockfile
|
|
COPY . .
|
|
ENV PATH=/app/node_modules/.bin:$PATH
|
|
RUN chown -R node:node /app
|
|
USER node
|
|
RUN pnpm run build
|
|
EXPOSE 1337
|
|
|
|
|
|
FROM build AS dev
|
|
CMD ["pnpm", "run", "dev"]
|
|
|
|
FROM build AS release
|
|
ENTRYPOINT ["pnpm", "run", "start"] |