diff --git a/client/wfprev-war/Dockerfile b/client/wfprev-war/Dockerfile index 9523ae9e..e9b12937 100644 --- a/client/wfprev-war/Dockerfile +++ b/client/wfprev-war/Dockerfile @@ -4,25 +4,13 @@ FROM node:20-alpine # Set the working directory inside the container WORKDIR /app -# Log the contents of the root directory before doing any copies -RUN echo "Root directory contents before copy:" && ls -la / - # Copy the pre-built Angular app from the local machine into the container COPY ./dist/wfprev ./dist/wfprev # COPY src/main/angular/dist/wfprev ./dist/wfprev -# Log the contents of the /app directory after copying -RUN echo "App directory contents after copy:" && ls -la /app - -# Log the contents of the /app/dist/wfprev directory after copying -RUN echo "wfprev directory contents after copy:" && ls -la /app/dist/wfprev - # Copy backend files (for serving the Angular app using Express) COPY backend /app -# Log the backend directory contents -RUN echo "Backend directory contents after backend copy:" && ls -la /app - RUN npm install --only=production # Expose port 80 for the application diff --git a/client/wfprev-war/README.md b/client/wfprev-war/README.md index 23a7763e..df80626d 100644 --- a/client/wfprev-war/README.md +++ b/client/wfprev-war/README.md @@ -11,12 +11,16 @@ Make sure you have the following installed before proceeding: ## Steps to Run the UI with Docker -### Build the Docker Image, run following command under wfprev-war folder where dockerfile locates. npm-token and registry-token can be retrieve from your npmrc -docker build -t wfprev-ui --build-arg NPM_TOKEN= --build-arg PRIVATE_REGISTRY_AUTH= . +### Run ng build +navigate to Angular folder and run "ng build --configuration production" +### Script change in dockerfile +comment out "COPY ./dist/wfprev ./dist/wfprev" part in Dockerfile, use "# COPY src/main/angular/dist/wfprev ./dist/wfprev" instead +### Build the Docker Image, run following command under wfprev-war folder where dockerfile locates. +docker build -t wfprev-ui Then you should see a wfprev-ui appears in your images list. ### Run the image using following command. -docker run -d -p 8080:80 --name wfprev-ui-container wfprev-ui +docker run -d -p 8080:8080 --name wfprev-ui-container wfprev-ui ### Verify the UI is running by opening the browser and navigate to localhost:8080