Skip to content

Commit

Permalink
Merge pull request #21 from noislabs/docker-updates
Browse files Browse the repository at this point in the history
Update docker setup
  • Loading branch information
webmaster128 committed Aug 24, 2023
2 parents dbf3371 + c6558d3 commit 5e5db3e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git

config.json
6 changes: 1 addition & 5 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ on:
push:
branches: [ "main" ]
tags: 'v*'
pull_request:
branches: [ "main" ]

jobs:

build:

build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
16 changes: 14 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
# See https://hub.docker.com/r/denoland/deno/tags for available images
FROM denoland/deno:alpine-1.36.1

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

# Prefer not to run as root.
USER deno

# Cache the dependencies as a layer (the following two steps are re-run only when deps.ts is modified).
# Ideally cache deps.ts will download and compile _all_ external files used in main.ts.
COPY deps.ts .
RUN deno cache deps.ts

COPY . .

# Compile the main app so that it doesn't need to be compiled each startup/entry.
RUN deno cache main.ts

CMD deno run --allow-read --allow-net --allow-env main.ts
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ Start:

```sh
docker run \
-v $PWD/config.json:/opt/drand-bot/config.json \
-v "$PWD/config.json":/app/config.json \
noislabs/nois-bot:nextgen
```

0 comments on commit 5e5db3e

Please sign in to comment.