diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..422f81a --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,38 @@ +# Builds the API/web image on main and pushes it to GHCR, so the CasaOS +# host can `docker compose pull` instead of building deps locally. +name: Docker image + +on: + push: + branches: [main] + workflow_dispatch: + +jobs: + build-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: | + ghcr.io/${{ github.repository }}:latest + ghcr.io/${{ github.repository }}:${{ github.sha }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/README.md b/README.md index b2e670a..7c1f287 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,8 @@ git pull docker compose up -d --build ``` +GitHub Actions runs tests + ruff on every PR (`.github/workflows/ci.yml`) and builds + pushes the image to GHCR on every merge to main (`.github/workflows/docker.yml`). To consume the prebuilt image on the CasaOS host instead of building locally, point the `api`/`web` services at `ghcr.io/agb1986/ai-data-store:latest` (already the `image:` in `docker-compose.yml`) and run `docker compose pull && docker compose up -d` — the local `build:` fallback keeps working either way. + ## Laptop setup Configure your MCP client with the server URL and API key printed during setup. diff --git a/docker-compose.yml b/docker-compose.yml index 89a15bc..b077ca5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,7 @@ services: api: build: . + image: ghcr.io/agb1986/ai-data-store:latest restart: unless-stopped ports: - "8742:8742" @@ -23,6 +24,7 @@ services: web: build: . + image: ghcr.io/agb1986/ai-data-store:latest restart: unless-stopped command: ["python", "-m", "app.web"] ports: