fix: Install all dependencies in server Dockerfile for TypeScript build, then prune dev deps
This commit is contained in:
@@ -10,8 +10,8 @@ WORKDIR /app
|
|||||||
# Copy package files
|
# Copy package files
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
# Install dependencies
|
# Install all dependencies (including dev for build)
|
||||||
RUN npm install --omit=dev
|
RUN npm install
|
||||||
|
|
||||||
# Copy source code
|
# Copy source code
|
||||||
COPY . .
|
COPY . .
|
||||||
@@ -19,6 +19,9 @@ COPY . .
|
|||||||
# Build TypeScript
|
# Build TypeScript
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
# Remove dev dependencies after build
|
||||||
|
RUN npm prune --omit=dev
|
||||||
|
|
||||||
# Expose port
|
# Expose port
|
||||||
EXPOSE 2567
|
EXPOSE 2567
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user