Add GHCR publishing workflow and update docker-compose for registry pull

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ubuntu 2026-02-23 21:39:23 +00:00
commit 8c2c4d2aef
4 changed files with 86 additions and 19 deletions

58
.github/workflows/docker-publish.yml vendored Normal file
View file

@ -0,0 +1,58 @@
name: Build and Publish
on:
push:
branches: [ "main" ]
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "main" ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=tag
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

View file

@ -13,6 +13,9 @@ FROM python:3.11-slim-bookworm
LABEL maintainer="K7ZVX <matt@echo6.co>" LABEL maintainer="K7ZVX <matt@echo6.co>"
LABEL description="MeshAI - LLM-powered Meshtastic assistant" LABEL description="MeshAI - LLM-powered Meshtastic assistant"
LABEL version="0.1.0" LABEL version="0.1.0"
LABEL org.opencontainers.image.source=https://github.com/zvx-echo6/meshai
LABEL org.opencontainers.image.description="MeshAI - LLM-powered Meshtastic assistant"
LABEL org.opencontainers.image.licenses=MIT
# Build arguments # Build arguments
ARG UID=1000 ARG UID=1000
@ -35,8 +38,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
# For process management # For process management
procps \ procps \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
# Install ttyd for web-based config interface # Install ttyd for web-based config interface (arch-aware)
&& curl -sL https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.x86_64 -o /usr/local/bin/ttyd \ && TTYD_ARCH=$(dpkg --print-architecture | sed 's/amd64/x86_64/' | sed 's/arm64/aarch64/') \
&& curl -sL "https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.${TTYD_ARCH}" -o /usr/local/bin/ttyd \
&& chmod +x /usr/local/bin/ttyd && chmod +x /usr/local/bin/ttyd
# Create non-root user # Create non-root user

View file

@ -133,20 +133,21 @@ DM: Tell me a short joke
### Quick Start with Docker ### Quick Start with Docker
```bash ```bash
# Clone and enter directory # Create working directory
git clone https://github.com/zvx-echo6/meshai.git mkdir -p meshai/data && cd meshai
cd meshai
# Copy example config # Download docker-compose file
cp config.example.yaml data/config.yaml curl -O https://raw.githubusercontent.com/zvx-echo6/meshai/main/docker-compose.yml
# Copy and edit config
curl -o data/config.yaml https://raw.githubusercontent.com/zvx-echo6/meshai/main/config.example.yaml
# Edit data/config.yaml with your settings # Edit data/config.yaml with your settings
# For TCP connection to Meshtastic node: # Start
docker compose -f docker-compose.yml -f docker-compose.tcp.yml up -d docker compose up -d
# For Serial connection: # View logs
# First edit docker-compose.serial.yml to set your device path docker compose logs -f
docker compose -f docker-compose.yml -f docker-compose.serial.yml up -d
``` ```
### Docker Configuration ### Docker Configuration

View file

@ -13,13 +13,17 @@
services: services:
meshai: meshai:
build: # Pull from GitHub Container Registry
context: . image: ghcr.io/zvx-echo6/meshai:latest
dockerfile: Dockerfile
args: # Uncomment to build locally instead of pulling
UID: ${UID:-1000} # build:
GID: ${GID:-1000} # context: .
image: meshai:latest # dockerfile: Dockerfile
# args:
# UID: ${UID:-1000}
# GID: ${GID:-1000}
container_name: meshai container_name: meshai
restart: unless-stopped restart: unless-stopped