From 0761b5ff4820ec31b30cf5cc861d29f602863322 Mon Sep 17 00:00:00 2001 From: Aman Dwivedi Date: Sun, 5 Dec 2021 19:18:50 +0530 Subject: [PATCH 1/2] update dashboard backend README Signed-off-by: Aman Dwivedi --- dashboard-backend/README.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/dashboard-backend/README.md b/dashboard-backend/README.md index 8fef11a23..0f9e1a55f 100644 --- a/dashboard-backend/README.md +++ b/dashboard-backend/README.md @@ -8,7 +8,7 @@ ## Installation Steps -- Create a GitHub [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) +- Create a GitHub [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). - Create a file `.env` and add the below content. ``` @@ -16,4 +16,23 @@ GITHUB_USERNAME=your_github_username GITHUB_PAT=your_github_personal_access_token ``` -- Replace `your_github_personal_access_token` with the actual token value created in first step and replace `your_github_username` with the GitHub account from which the token was created. +- Replace `your_github_personal_access_token` with the actual token value created in the first step and replace `your_github_username` with the GitHub account from which the token was created. + +- Run the below command to install the required dependencies. +``` +go mod download +``` + +## Run locally + +Run the below command to start the server: + +``` +go run main.go +``` + +Go to: http://localhost:8080 + +## Contributing + +We like contributions in several forms, see [CONTRIBUTING.md](https://github.com/litmuschaos/litmus-e2e/blob/master/CONTRIBUTING.md) for more details. From 4284ce8284ef42e9fd7792040e661053fb71793f Mon Sep 17 00:00:00 2001 From: Aman Dwivedi Date: Sun, 5 Dec 2021 19:23:14 +0530 Subject: [PATCH 2/2] add Dockerfile for dashboard backend Signed-off-by: Aman Dwivedi --- dashboard-backend/.dockerignore | 15 +++++++++++++++ dashboard-backend/Dockerfile | 20 ++++++++++++++++++++ dashboard-backend/README.md | 5 +++-- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 dashboard-backend/.dockerignore create mode 100644 dashboard-backend/Dockerfile diff --git a/dashboard-backend/.dockerignore b/dashboard-backend/.dockerignore new file mode 100644 index 000000000..a0c132150 --- /dev/null +++ b/dashboard-backend/.dockerignore @@ -0,0 +1,15 @@ +# Source code +.git* +.dockerignore +Dockerfile* +docker-compose* + +# Logs +logs +*.log + +# VS Code +.vscode + +# ENV +*.env \ No newline at end of file diff --git a/dashboard-backend/Dockerfile b/dashboard-backend/Dockerfile new file mode 100644 index 000000000..1e5611200 --- /dev/null +++ b/dashboard-backend/Dockerfile @@ -0,0 +1,20 @@ +FROM golang:alpine + +LABEL maintainer="LitmusChaos" + +RUN mkdir /usr/app + +WORKDIR /usr/app + +COPY go.mod ./ +COPY go.sum ./ + +RUN go mod download + +COPY . . + +RUN go build -o /dashboard-backend + +EXPOSE 8080 + +CMD [ "/dashboard-backend" ] diff --git a/dashboard-backend/README.md b/dashboard-backend/README.md index 0f9e1a55f..329883b28 100644 --- a/dashboard-backend/README.md +++ b/dashboard-backend/README.md @@ -19,7 +19,8 @@ GITHUB_PAT=your_github_personal_access_token - Replace `your_github_personal_access_token` with the actual token value created in the first step and replace `your_github_username` with the GitHub account from which the token was created. - Run the below command to install the required dependencies. -``` + +```go go mod download ``` @@ -27,7 +28,7 @@ go mod download Run the below command to start the server: -``` +```go go run main.go ```