diff --git a/Dockerfile b/Dockerfile index 1e0dfdcce..ef9f31dc6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,8 +33,8 @@ COPY ./nx.json nx.json COPY ./replace.build.mjs replace.build.mjs COPY ./tsconfig.base.json tsconfig.base.json -# Update build command for Nx 21 -RUN npx nx run-many --target=build --projects=api,client --configuration=production +# Use build:production script from package.json (with Nx 21 syntax) +RUN npm run build:production # Prepare the dist image with additional node_modules WORKDIR /ghostfolio/dist/apps/api diff --git a/package.json b/package.json index d0e613cfa..1d5eea3a6 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "affected:test": "nx affected:test", "analyze:client": "nx run client:build:production --stats-json && webpack-bundle-analyzer -p 1234 dist/apps/client/en/stats.json", "angular": "node --max_old_space_size=32768 ./node_modules/@angular/cli/bin/ng", - "build:production": "nx run api:copy-assets && nx run api:build:production && nx run client:copy-assets && nx run client:build:production && nx run ui:build-storybook && npm run replace-placeholders-in-build", + "build:production": "npx nx run-many --target=copy-assets --projects=api,client && npx nx run-many --target=build --projects=api,client --configuration=production && npx nx run ui:build-storybook && npm run replace-placeholders-in-build", "build:storybook": "nx run ui:build-storybook", "database:format-schema": "prisma format", "database:generate-typings": "prisma generate",