Skip to content

Commit

Permalink
Add docker setup (#18)
Browse files Browse the repository at this point in the history
* Add Dockerfile and GHCR publish action

Closes #6
  • Loading branch information
0237h authored Oct 17, 2023
1 parent dd69ea2 commit bd858d8
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 6 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/ghcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: GitHub Container Registry
on:
release:
types: [ published ]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
ghcr:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{raw}}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM oven/bun
COPY . .
RUN bun install
ENTRYPOINT [ "bun", "./index.ts" ]
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@ Options:
-h, --help display help for command
```

## Docker environment (SOON)
## Docker environment

<!-- Pull from GitHub Container registry
Pull from GitHub Container registry
```bash
docker pull ghcr.io/pinax-network/substreams-sink-websockets:latest
docker pull ghcr.io/pinax-network/substreams-clock-api:latest
```

Build from source
```bash
docker build -t substreams-sink-websockets .
docker build -t substreams-clock-api .
```

Run with `.env` file
```bash
docker run -it --rm --env-file .env ghcr.io/pinax-network/substreams-sink-websockets
``` -->
docker run -it --rm --env-file .env ghcr.io/pinax-network/substreams-clock-api
```

0 comments on commit bd858d8

Please sign in to comment.