Skip to content

refactor(api): resolve container writes to collection ids once #4

refactor(api): resolve container writes to collection ids once

refactor(api): resolve container writes to collection ids once #4

Workflow file for this run

name: Container Build (PR)
# Verifies the Dockerfile still builds on PRs that touch build inputs.
# Does not push the image. Single-arch (amd64) for speed; the release
# workflow handles multi-arch on actual releases.
on:
pull_request:
paths:
- "Dockerfile"
- ".dockerignore"
- "package.json"
- "bun.lock"
- "packages/api/**"
- "packages/contract/**"
- "packages/web/**"
- "packages/docs/**"
- ".github/workflows/pr-container.yml"
- ".github/workflows/nightly-container.yml"
- ".github/workflows/release-container.yml"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: pr-container-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build (no push)
uses: docker/build-push-action@v7
with:
build-args: |
APP_BUILD_ID=${{ github.sha }}
context: .
file: ./Dockerfile
platforms: linux/amd64
push: false
load: true
tags: sampledb:pr-smoke
cache-from: type=gha,scope=sampledb
cache-to: type=gha,mode=max,scope=sampledb
- name: Smoke test container startup
run: |
docker run -d --name sampledb-smoke \
-p 3000:3000 \
-e DATABASE_PATH=/tmp/sampledb.sqlite \
-e ALLOWED_ORIGINS=http://localhost:3000 \
sampledb:pr-smoke
cleanup() {
docker logs sampledb-smoke 2>&1 || true
docker rm -f sampledb-smoke 2>/dev/null || true
}
trap cleanup EXIT
for i in $(seq 1 30); do
if curl -sf http://127.0.0.1:3000/health >/dev/null; then
echo "Health check passed after ${i}s"
exit 0
fi
sleep 1
done
echo "Container failed to respond on /health within 30s"
exit 1