opensearch-project / automation-app

🤖 An automation app to handle the daily activities of your GitHub Repository.
Apache License 2.0
1 stars 4 forks source link

Adding a Dockerfile to run the app through docker #9

Closed peterzhuamazon closed 1 month ago

peterzhuamazon commented 1 month ago

Adding a Dockerfile to run the app through docker

prudhvigodithi commented 1 month ago

Having a Dockerized solution will help run the app with multiple ports, with different resource and operation files.

prudhvigodithi commented 1 month ago

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:

Dockerfile

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 . .

Docker Compose Files

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

prudhvigodithi commented 1 month ago

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.

prudhvigodithi commented 1 month ago

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

peterzhuamazon commented 1 month ago

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.