Skip to content

Commit

Permalink
Fix(Dockerfile): install dev deps for plugin build
Browse files Browse the repository at this point in the history
Co-Authored-By: ekl176 <169838059+ekl176@users.noreply.github.com>
Co-Authored-By: Rafael Falk <rbrtrflflk@gmail.com>
Co-Authored-By: Spencer Peace <47868304+Spencer6497@users.noreply.github.com>
Co-Authored-By: Florian Drews <10455916+m0dh4x@users.noreply.github.com>
  • Loading branch information
5 people committed Dec 16, 2024
1 parent 7a5e573 commit ba75a11
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ba75a11

Please sign in to comment.