Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker #18

Merged
merged 3 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's give it a fancy tag name, like

Suggested change
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/nois-bot:0.2.0
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/nois-bot:nextgen

This makes it cleaner as we push unversioned updates to that tag

7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See https://hub.docker.com/r/denoland/deno/tags for available images
FROM denoland/deno:alpine-1.34.3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
FROM denoland/deno:alpine-1.34.3
FROM denoland/deno:alpine-1.36.1


COPY . /opt/drand-bot
WORKDIR /opt/drand-bot

CMD deno run --allow-read --allow-net --allow-env main.ts
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a step to pull the latest version of the tag?


```sh
docker run -v $PWD/config.json:/opt/drand-bot/config.json noislabs/nois-bot:0.2.0
```
Loading