From 9ee0de30a429f0abfa98f060c8ae93e1a1f6b03f Mon Sep 17 00:00:00 2001 From: Ladd Hoffman Date: Wed, 19 Jul 2023 05:38:17 -0500 Subject: [PATCH] Add dockerfile and basic CI config --- .nvmrc | 1 + Dockerfile | 14 ++++++++++++++ README.md | 6 ++++++ docs/.gitlab-ci.yml | 12 ++++++++++++ 4 files changed, 33 insertions(+) create mode 100644 .nvmrc create mode 100644 Dockerfile create mode 100644 docs/.gitlab-ci.yml diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..209e3ef --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ed2d989 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM node:20 + +RUN apt-get -y update && apt-get -y upgrade +RUN npm install --global npm +RUN mkdir -p /opt/reputation-api +WORKDIR /opt/reputation-api + +ADD package.json package-lock.json nest-cli.json tsconfig.json tsconfig.build.json ./ +ADD src/ ./src/ + +RUN npm install +RUN npm run build + +CMD ["npm", "start"] \ No newline at end of file diff --git a/README.md b/README.md index 0261764..f9282c3 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,12 @@ Reputation API is an implementation of DGF (DAO Governance Framework) for Reputa For more detailed information about DGF, please refer to the [DOA Governance Framework Wiki](https://daogovernanceframework.com/wiki/DAO_Governance_Framework). +## Development + +Install [nvm](https://nvm.sh), and then use it to install the correct version of `node` + + nvm install + ## Technology Stack ### Node.js diff --git a/docs/.gitlab-ci.yml b/docs/.gitlab-ci.yml new file mode 100644 index 0000000..27ebc7d --- /dev/null +++ b/docs/.gitlab-ci.yml @@ -0,0 +1,12 @@ +variables: + IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + +before_script: + - podman login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + +oci-container-build: + stage: build + script: + - podman build -t $IMAGE_TAG . + - podman push $IMAGE_TAG + when: manual