diff --git a/Dockerfile b/Dockerfile index 296f67f..f0ebaaa 100755 --- a/Dockerfile +++ b/Dockerfile @@ -5,24 +5,20 @@ RUN apk update && apk add --no-cache build-base zlib-dev libpng-dev vips-dev > / ARG NODE_ENV=production ENV NODE_ENV=${NODE_ENV} -WORKDIR /opt/ -COPY package.json package-lock.json ./ -COPY ./patches/* ./patches/ -RUN npm ci --omit=dev -ENV PATH /opt/node_modules/.bin:$PATH WORKDIR /opt/app COPY . . +RUN npm ci --include=dev RUN npm run build +RUN npm prune --omit=dev # Creating final production image FROM node:20-alpine RUN apk add --no-cache vips-dev ARG NODE_ENV=production ENV NODE_ENV=${NODE_ENV} -WORKDIR /opt/ -COPY --from=build /opt/node_modules ./node_modules WORKDIR /opt/app COPY --from=build /opt/app ./ +RUN mv ./node_modules ../ ENV PATH /opt/node_modules/.bin:$PATH RUN mkdir -p /opt/app/database/migrations