Skip to content

Commit

Permalink
docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Lefebvre committed Oct 18, 2023
1 parent 293c2af commit 6efa7e8
Show file tree
Hide file tree
Showing 3 changed files with 55 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" ]
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,22 @@ 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-erc20-api:latest
```

Build from source

```bash
docker build -t substreams-sink-websockets .
docker build -t substreams-erc20-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-erc20-api
```

0 comments on commit 6efa7e8

Please sign in to comment.