Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fcaaa1d03c | |||
| 77e992e14d |
@@ -0,0 +1,53 @@
|
||||
name: Publish Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: Publish Docker Image
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=tag
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=sha,prefix=
|
||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
@@ -59,12 +59,33 @@ Open `.env`, define your own strong `API_KEY`, and map the ports (optional)
|
||||
#### Option A: Docker Compose (Recommended)
|
||||
The easiest way to get up and running. This spins up both toknd and a dedicated Redis instance.
|
||||
|
||||
- **Production**:
|
||||
```bash
|
||||
docker compose up -d --build
|
||||
(or)
|
||||
podman compose up -d --build
|
||||
```
|
||||
You can run toknd by building the container locally or by pulling the pre-built image from the **GitHub Container Registry (GHCR)**.
|
||||
|
||||
##### Using Pre-built Image (GHCR)
|
||||
Instead of building locally, you can pull the pre-built image. Update the `app` service in `docker-compose.yml` to pull the image:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
app:
|
||||
image: ghcr.io/ramvignesh-b/toknd:latest
|
||||
# build: . # Comment or remove this line
|
||||
```
|
||||
|
||||
Then start the services:
|
||||
```bash
|
||||
docker compose up -d
|
||||
(or)
|
||||
podman compose up -d
|
||||
```
|
||||
|
||||
##### Building from Source
|
||||
If you prefer to build the image locally:
|
||||
```bash
|
||||
docker compose up -d --build
|
||||
(or)
|
||||
podman compose up -d --build
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Option B: Bare Metal
|
||||
|
||||
Reference in New Issue
Block a user