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 8fef11a23..329883b28 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,24 @@ 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 +go mod download +``` + +## Run locally + +Run the below command to start the server: + +```go +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.