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

Update docker setup #21

Merged
merged 1 commit into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
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
```
Loading