From ec1d0cb31a32ad881870154d1c35be463be6c84e Mon Sep 17 00:00:00 2001 From: Kais Date: Thu, 10 Aug 2023 19:44:24 +0100 Subject: [PATCH 1/3] docker --- .github/workflows/docker-image.yml | 31 ++++++++++++++++++++++++++++++ Dockerfile | 7 +++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/docker-image.yml create mode 100644 Dockerfile diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..219cdc4 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,31 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + tags: 'v*' + pull_request: + branches: [ "main" ] + +jobs: + + build: + + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/nois-bot:0.2.0 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4d28977 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +# See https://hub.docker.com/r/denoland/deno/tags for available images +FROM denoland/deno:alpine-1.34.3 + +COPY . /opt/drand-bot +WORKDIR /opt/drand-bot + +CMD deno run --allow-read --allow-net --allow-env main.ts From 415cf47363d206b5d1c9f208f7d308b63d427f93 Mon Sep 17 00:00:00 2001 From: Kais Date: Thu, 10 Aug 2023 19:54:26 +0100 Subject: [PATCH 2/3] doc --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 3cad7c6..31254a4 100644 --- a/README.md +++ b/README.md @@ -86,3 +86,16 @@ pm2 restart main && pm2 logs --lines 100 #stop bot pm2 stop main ``` + +## Run in docker + +Make sure you have + +- config.json file in your current directory +- Docker installed and running + +Run this command + +```sh +docker run -v $PWD/config.json:/opt/drand-bot/config.json noislabs/nois-bot:0.2.0 +``` From 60d035af3e685955a199eb3fbe27236e31bfa104 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Thu, 24 Aug 2023 20:19:51 +0200 Subject: [PATCH 3/3] Update docker tag and deno version --- .github/workflows/docker-image.yml | 2 +- Dockerfile | 2 +- README.md | 14 +++++++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 219cdc4..b31a442 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -28,4 +28,4 @@ jobs: context: . file: ./Dockerfile push: true - tags: ${{ secrets.DOCKER_HUB_USERNAME }}/nois-bot:0.2.0 + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/nois-bot:nextgen diff --git a/Dockerfile b/Dockerfile index 4d28977..14afd00 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # See https://hub.docker.com/r/denoland/deno/tags for available images -FROM denoland/deno:alpine-1.34.3 +FROM denoland/deno:alpine-1.36.1 COPY . /opt/drand-bot WORKDIR /opt/drand-bot diff --git a/README.md b/README.md index 31254a4..0d96a7f 100644 --- a/README.md +++ b/README.md @@ -87,15 +87,23 @@ pm2 restart main && pm2 logs --lines 100 pm2 stop main ``` -## Run in docker +## Run in Docker Make sure you have - config.json file in your current directory - Docker installed and running -Run this command +Update to latest version: ```sh -docker run -v $PWD/config.json:/opt/drand-bot/config.json noislabs/nois-bot:0.2.0 +docker pull noislabs/nois-bot:nextgen +``` + +Start: + +```sh +docker run \ + -v $PWD/config.json:/opt/drand-bot/config.json \ + noislabs/nois-bot:nextgen ```