Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock.json
yarn.lock

# Build artifacts
target/
Expand Down
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Use Node.js 18 as base image, then add Java
# Use Node.js 18 as base image, then add Java
FROM node:18-slim

# Set working directory
Expand All @@ -25,7 +25,13 @@ COPY examples/basicauthentication/ui.resources /app/ui.resources

# Build the Angular frontend first
WORKDIR /app/ui.resources
RUN yarn install && yarn build
# Use npm instead of yarn for better Docker reliability
# Add network timeout and retry configurations
RUN npm config set fetch-retry-mintimeout 20000 && \
npm config set fetch-retry-maxtimeout 120000 && \
npm config set fetch-retries 5 && \
npm install && \
npm run build

# Go back to app directory and build the Java application
WORKDIR /app
Expand Down
7 changes: 4 additions & 3 deletions examples/basicauthentication/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@
</configuration>
<executions>
<execution>
<id>exec-yarn-install</id>
<id>exec-npm-install</id>
<phase>generate-sources</phase>
<configuration>
<executable>yarn</executable>
<executable>npm</executable>
<arguments>
<argument>install</argument>
</arguments>
Expand All @@ -209,8 +209,9 @@
<id>exec-ngcli-build</id>
<phase>generate-sources</phase>
<configuration>
<executable>ng</executable>
<executable>npx</executable>
<arguments>
<argument>ng</argument>
<argument>build</argument>
<argument>--base-href=#context-path#</argument>
</arguments>
Expand Down
Loading