Skip to content

Commit

Permalink
Optimised build pipeline so that all assets are compiled
Browse files Browse the repository at this point in the history
  • Loading branch information
DrizzlyOwl committed Nov 28, 2024
1 parent cbb5d67 commit 19b1803
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"scripts": {
"build": "npm run build:assets & npm run build:frontend",
"build:frontend": "webpack --mode=production",
"build:assets": "webpack --config webpack.assets.config.js --mode=production & webpack --config webpack.appinsights.config.js --mode=production",
"build:watch": "webpack --mode=development --watch"
"build": "webpack --config webpack.assets.config.js --mode=production & webpack --config webpack.config.js --mode=production & webpack --config webpack.appinsights.config.js --mode=production",
"build:watch": "webpack --config webpack.assets.config.js --mode=development --watch & webpack --config webpack.config.js --watch --mode=development & webpack --config webpack.appinsights.config.js --watch --mode=development"
},
"devDependencies": {
"copy-webpack-plugin": "^7.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@
display: inline;
line-height: 2;
}

5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN dotnet publish Dfe.PrepareConversions -c Release -o /app --no-restore

# Stage 2 - Build assets
FROM node:${NODEJS_IMAGE_TAG} as build

Check warning on line 19 in Dockerfile

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 19 in Dockerfile

View workflow job for this annotation

GitHub Actions / Deploy / Build and push to GHCR

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
COPY --from=publish /app /app
COPY ./Dfe.PrepareConversions/Dfe.PrepareConversions/wwwroot /app/wwwroot
WORKDIR /app/wwwroot
RUN npm install
RUN npm run build
Expand All @@ -26,7 +26,8 @@ RUN npm run build
ARG ASPNET_IMAGE_TAG
FROM "mcr.microsoft.com/dotnet/aspnet:${ASPNET_IMAGE_TAG}" AS final
LABEL org.opencontainers.image.source=https://github.com/DFE-Digital/prepare-academy-conversions
COPY --from=build /app /app
COPY --from=publish /app /app
COPY --from=build /app/wwwroot /app/wwwroot

WORKDIR /app
COPY ./script/web-docker-entrypoint.sh ./docker-entrypoint.sh
Expand Down

0 comments on commit 19b1803

Please sign in to comment.