Skip to content

Commit

Permalink
Update docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Aug 24, 2023
1 parent dbf3371 commit c6558d3
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 c6558d3

Please sign in to comment.