Skip to content

Commit

Permalink
Update Dockerfile to use Node 14 and streamline build process
Browse files Browse the repository at this point in the history
- Downgraded Node.js version from 18 to 14 for compatibility.
- Simplified npm installation by removing cache cleaning and legacy peer dependencies flag.
- Removed increased memory allocation for the build process, optimizing the Dockerfile for a more straightforward build.
  • Loading branch information
xuwenyihust committed Dec 10, 2024
1 parent e5016d6 commit 8dc6f7c
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions webapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
# Stage 1: Build the React application
FROM node:18 as build
FROM node:14 as build
WORKDIR /app

# Copy package files
COPY package*.json ./

# Clear npm cache and install dependencies
RUN npm cache clean --force && \
npm install --legacy-peer-deps && \
npm install @jridgewell/gen-mapping

# Copy the rest of the application
RUN npm install
COPY . .

# Build the application with increased memory allocation
ENV NODE_OPTIONS="--max-old-space-size=4096"
RUN npm run build

# Stage 2: Serve the app with nginx
Expand Down

0 comments on commit 8dc6f7c

Please sign in to comment.