Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VITE_ECR_BASE_URL=http://localhost:8081
VITE_BYPASS_AUTH=false
VITE_REFRESH_TIME=60000
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.eslintcache
.env
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Step 1: Build the app
FROM node:20-alpine AS builder

WORKDIR /app

COPY package*.json ./
COPY tsconfig.json ./
COPY vite.config.ts ./
COPY ./src ./src
COPY ./public ./public

RUN npm install

COPY . .
RUN npm run build

# Step 2: Serve with Nginx
FROM nginx:stable-alpine as production

COPY --from=builder /app/dist /usr/share/nginx/html

# Optional: Replace default Nginx config (recommended)
COPY nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
36 changes: 1 addition & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,38 +35,4 @@ Change the REACT_APP_ECR_BASE_URL value to use the eCRNow backend service base U

### Additional Configuration Changes:

To build and deploy the application in Production environment or to any Tomcat web server. The detailed instructions are documented and present in this repository. File Name: Steps to Run eCRNow-UI.docx

## Setup and Usage full docker mode

### Build the Docker Image
Run the following command to build the Docker image:

```sh
docker build --build-arg REACT_APP_ECR_BASE_URL=http://localhost:8081 \
--build-arg REACT_APP_BYPASS_AUTH=true \
-t ecrnow-ui:latest \
-f docker/Dockerfile .
```

### Run the Container
Use this command to start the container:

```sh
docker run -d -p 3000:80 --name ecrnow-ui ecrnow-ui:latest
```

### Access the Application
Once the container is running, open your browser and go to:
```
http://localhost:3000
```

### Stop and Remove the Container
```sh
docker stop ecrnow-ui && docker rm ecrnow-ui
```

## Notes
- Ensure that the `nginx.conf` file is correctly set up inside the `docker` directory.
- If using `docker-compose`, update the paths accordingly.
To build and deploy the application in Production environment or to any Tomcat web server. The detailed instructions are documented and present in this repository. File Name: Steps to Run eCRNow-UI.docx
19 changes: 19 additions & 0 deletions db.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"posts": [
{
"id": 1,
"title": "json-server",
"author": "typicode"
}
],
"comments": [
{
"id": 1,
"body": "some comment",
"postId": 1
}
],
"profile": {
"name": "typicode"
}
}
38 changes: 0 additions & 38 deletions docker/Dockerfile

This file was deleted.

118 changes: 0 additions & 118 deletions docker/README.md

This file was deleted.

20 changes: 0 additions & 20 deletions docker/docker-compose.yml

This file was deleted.

24 changes: 0 additions & 24 deletions docker/nginx.conf

This file was deleted.

Loading