diff --git a/services/auth/Dockerfile b/services/auth/Dockerfile index 908ddb7..b6ec99d 100644 --- a/services/auth/Dockerfile +++ b/services/auth/Dockerfile @@ -2,8 +2,10 @@ FROM node:20-alpine AS build WORKDIR /app COPY package.json package-lock.json* ./ # npm ci, not npm install: the image must be the lockfile's content, not -# whatever resolves the day it is built. -RUN npm ci +# whatever resolves the day it is built. --include=dev because this stage +# needs typescript, and npm omits devDependencies when NODE_ENV=production - +# which the deployment sets. +RUN npm ci --include=dev COPY . . RUN npm run build diff --git a/services/storage/Dockerfile b/services/storage/Dockerfile index 96ccdf8..6d4862b 100644 --- a/services/storage/Dockerfile +++ b/services/storage/Dockerfile @@ -2,8 +2,10 @@ FROM node:20-alpine AS build WORKDIR /app COPY package.json package-lock.json* ./ # npm ci, not npm install: the image must be the lockfile's content, not -# whatever resolves the day it is built. -RUN npm ci +# whatever resolves the day it is built. --include=dev because this stage +# needs typescript, and npm omits devDependencies when NODE_ENV=production - +# which the deployment sets. +RUN npm ci --include=dev COPY . . RUN npm run build diff --git a/services/webmail/Dockerfile b/services/webmail/Dockerfile index d16f193..952540b 100644 --- a/services/webmail/Dockerfile +++ b/services/webmail/Dockerfile @@ -1,7 +1,9 @@ FROM node:20-alpine AS build WORKDIR /app COPY package.json package-lock.json* ./ -RUN npm ci +# --include=dev: the Next build needs devDependencies, and npm omits them +# when NODE_ENV=production, which the deployment sets. +RUN npm ci --include=dev COPY . . RUN npm run build