Skip to content

Commit

Permalink
clean up and update reame for dockerfile (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
yzlucas authored Oct 18, 2024
1 parent 6174a0d commit 2bbbe82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
12 changes: 0 additions & 12 deletions client/wfprev-war/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions client/wfprev-war/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<your-npm-token> --build-arg PRIVATE_REGISTRY_AUTH=<your-private-registry-token> .
### 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

0 comments on commit 2bbbe82

Please sign in to comment.