CLear yarn package at build
This commit is contained in:
@@ -17,10 +17,7 @@ WORKDIR /app
|
|||||||
|
|
||||||
# Copy the package.json and package-lock.json first to leverage Docker's cache
|
# Copy the package.json and package-lock.json first to leverage Docker's cache
|
||||||
COPY ./src/Managing.WebApp/package*.json ./
|
COPY ./src/Managing.WebApp/package*.json ./
|
||||||
#RUN npm config set registry http://registry.cnpmjs.org
|
|
||||||
# Install dependencies
|
|
||||||
#RUN npm ci --production --loglevel=verbose
|
|
||||||
#RUN npm i --omit=dev --loglevel=verbose
|
|
||||||
RUN apk update && apk add --no-cache git
|
RUN apk update && apk add --no-cache git
|
||||||
# Remove Yarn and Yarnpkg binaries if they exist
|
# Remove Yarn and Yarnpkg binaries if they exist
|
||||||
RUN rm -f /usr/local/bin/yarn /usr/local/bin/yarnpkg
|
RUN rm -f /usr/local/bin/yarn /usr/local/bin/yarnpkg
|
||||||
@@ -28,19 +25,22 @@ RUN rm -f /usr/local/bin/yarn /usr/local/bin/yarnpkg
|
|||||||
# Install Yarn globally
|
# Install Yarn globally
|
||||||
RUN npm install -g yarn
|
RUN npm install -g yarn
|
||||||
|
|
||||||
|
# Clear Yarn cache
|
||||||
|
RUN yarn cache clean
|
||||||
|
|
||||||
#RUN npm i --max-old-space-size=12000 --loglevel=verbose
|
# Use npm registry
|
||||||
#RUN yarn add eslint-plugin-jsdoc@37.9.7 --dev --ignore-engines
|
RUN yarn config set registry https://registry.npmjs.org/
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
RUN yarn install --verbose
|
RUN yarn install --verbose
|
||||||
|
|
||||||
# Copy the application code
|
# Copy the application code
|
||||||
COPY ./src/Managing.WebApp/ /app/
|
COPY ./src/Managing.WebApp/ /app/
|
||||||
RUN ls -alh
|
RUN ls -alh
|
||||||
RUN ls -alh src/
|
RUN ls -alh src/
|
||||||
# Build the Vite application
|
|
||||||
#RUN npm run build
|
|
||||||
#RUN node --max-old-space-size=8192 ./node_modules/.bin/vite build
|
|
||||||
|
|
||||||
|
# Build the Vite application
|
||||||
|
RUN node --max-old-space-size=8192 ./node_modules/.bin/vite build
|
||||||
|
|
||||||
# Stage 2: Create the runtime image
|
# Stage 2: Create the runtime image
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
@@ -55,4 +55,4 @@ COPY --from=builder /app/dist /usr/share/nginx/html
|
|||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
# Start the Nginx server
|
# Start the Nginx server
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
Reference in New Issue
Block a user