Closed peterzhuamazon closed 1 month ago
Having a Dockerized solution will help run the app with multiple ports, with different resource and operation files.
Did a small POC on this. Until we have a full image release for the opensearch-project/automation-app
in https://hub.docker.com/u/opensearchproject we can do the following:
This file will be part of the repo https://github.com/opensearch-project/automation-app/. This controls the node version and dependencies.
FROM node:20.17.0
WORKDIR /usr/app
COPY package*.json ./
RUN npm cache clean --force
COPY . .
OPERATION_CONFIG
's and on different ports we can run the following compose files.docker-compose -f compose-1.yaml up -d
and docker-compose -f compose-2.yaml up -d
.docker-compose
cli.services:
web-1:
build: .
command:
- /bin/bash
- -c
- |
npm install
npm start
environment:
- RESOURCE_CONFIG=configs/resources/sample-resource.yml
- OPERATION_CONFIG=configs/operations/github-workflow-runs-monitor.yml
volumes:
- .:/usr/app/
- /usr/app/node_modules
ports:
- "8080:3000"
services:
web-2:
build: .
command:
- /bin/bash
- -c
- |
npm install
npm start
environment:
- RESOURCE_CONFIG=configs/resources/sample-resource.yml
- OPERATION_CONFIG=configs/operations/github-merged-pulls-monitor.yml
volumes:
- .:/usr/app/
- /usr/app/node_modules
ports:
- "8081:3000"
Thank you @getsaurabh02 @dblock @peterzhuamazon
Here is the example https://github.com/opensearch-project/opensearch-metrics/pull/78 on how a downstream repo can leverage this dockerized setup of the automation app.
Closing this issue, as we have a docker solution https://github.com/opensearch-project/automation-app/tree/main?tab=readme-ov-file#start-the-service-with-docker to run the app. Thanks @peterzhuamazon @getsaurabh02
Closing this issue, as we have a docker solution https://github.com/opensearch-project/automation-app/tree/main?tab=readme-ov-file#start-the-service-with-docker to run the app. Thanks @peterzhuamazon @getsaurabh02
We still a few more improvements on that. But for now it works with the metrics cluster.
Thanks.
Adding a Dockerfile to run the app through docker