-
I'm using semantic release in an Angular Single Page Application project and have created some scripts with Dockerfiles to create the project's bundle automatically. But this can be related to all other back-end NodeJS and Single Page Application frameworks such as React, Vue, etc. The problem with semantic release is that is updates package.json all the time, consequently invalidating the node_modules cache Docker builds. Every package.json modification triggers a new npm install from scratch inside the container, triggering an entire dependecy packages download every new update. This is the Dockerfile I'm using: # Stage 1: Generate/Build the application bundle
FROM node:20 as angular-builder
# Set the working directory
WORKDIR /usr/local/app
# Add the source code to app
COPY package.json package-lock.json .
# Install all the dependencies
RUN npm install
# Copying the remaining source code
COPY . .
# Generate the application's build
RUN npm run build
# Stage 2: Copy Angular bundled files to a folder in a scratch image
# Use official scratch image as the base image
FROM scratch
# Copy the build output to replace the app directory.
COPY --from=angular-builder /usr/local/app/dist/* /app/
CMD ["echo", "finished!"] How do you people solve this problem? How to automate and Angular SPA project bundle generation "ng build" without triggering a full dependency download using this Docker and semantic release? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
this only happens if you opt-in to this behavior. is there a reason you have chosen to do so, despite our recommendation?
what is the value that semantic-release is providing to your project? is releasing with a semantic version important for your application in some way? normally, a semantic version is most valuable to projects that produce assets that are consumed as dependencies of other projects, which is normally not the case for applications? I'm wondering if you might be overcomplicating your process by trying to use semantic-release for tasks that it isnt really targeted at |
Beta Was this translation helpful? Give feedback.
this only happens if you opt-in to this behavior. is there a reason you have chosen to do so, despite our recommendation?
what is the value that semantic-release is providing to your project? is releasing with a semantic version important for your application in some way? normally, a semantic version is most valuable to projects that produce assets that are consumed as dependencies of other projects, which is normally not the case for applications? I'm wondering if you might be overcomplicating your process by trying to use semantic-re…