Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devops #1732

Open
wants to merge 1 commit into
base: develop-1.1.0
Choose a base branch
from
Open

Devops #1732

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
45 changes: 45 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Ignore node_modules to avoid copying them
**/node_modules
cypress
# Ignore any log files
*.log

# Ignore environment variables
.env

# Ignore Docker-related files
Dockerfile
.dockerignore

# Ignore test directories
test
tests
__tests__
__mocks__

# Ignore documentation
docs
*.md

# Ignore build output directories
dist
build
public

# Ignore system files
.DS_Store
Thumbs.db

# Ignore IDE and editor configuration files
.vscode
.idea
*.iml

# Ignore yarn cache and lock files that aren't needed
.yarn/*
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
yarn-error.log
**/Jenkinsfile
74 changes: 74 additions & 0 deletions DOCKER_BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Dockerfile for Monorepo Applications

This repository contains a Dockerfile designed to build and run different applications from a monorepo. The build process uses a build argument to specify which application to build and run.

## How to Use

### Build the Docker Image

To build the Docker image for a specific application, use the `--build-arg` option to pass the `BUILD_TARGET` argument. Replace `<app-name>` with the name of the application you want to build.

```sh
docker build --build-arg BUILD_TARGET=<app-name> -t <image-name> .
```

#### Example

To build the Docker image for the `retail` application:

```sh
docker build --build-arg BUILD_TARGET=retail -t retail-app .
```

### Run the Docker Container

After building the Docker image, you can run the Docker container. Use the `-p` option to map the container's port to your host's port.

```sh
docker run -p <host-port>:3000 <image-name>
```

#### Example

To run the Docker container for the `retail` application:

```sh
docker run -p 3000:3000 retail-app
```

### Available Applications

Here are the available applications you can build and run:

- `osm`
- `common`
- `dsep`
- `odr`
- `dhp`
- `pg`
- `dsnp`
- `industry_4.0`
- `regen-agri`
- `taxi-bpp`
- `retail`
- `mobility-bap`
- `tourismV1.1`
- `tourism`
- `OSC`
- `dsnp-v2`
- `odr-v2`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prasad-takale-eminds older applications are removed from the migrated branch. Can you validate all the applications once ? Apps like dsnp and odr are removed


### Example Workflow

1. **Build the Docker image for the `retail` application:**
```sh
docker build --build-arg BUILD_TARGET=retail -t retail-app .
```

2. **Run the Docker container for the `retail` application:**
```sh
docker run -p 3000:3000 retail-app
```

Replace `retail` with any other application name from the list above to build and run different applications.

26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use the official Node.js 18 LTS image as the base image
FROM node:18.18.2-alpine3.18

# Set the working directory in the container
WORKDIR /app

# Copy the package.json and yarn.lock files to the container
COPY package.json yarn.lock ./


# Copy the rest of the application code to the container
COPY . .

# Install dependencies
RUN yarn install

# Build the application based on the provided build target
ARG BUILD_TARGET
RUN yarn build:${BUILD_TARGET}


# Expose the port the application runs on (adjust if necessary)
EXPOSE 3000

# Start the application
CMD ["yarn", "workspace", "@beckn-ui/${BUILD_TARGET}", "start"]