Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ WORKDIR /app
ENV NODE_ENV=production
ENV HOSTNAME=0.0.0.0
ENV PORT=3001
# ARGs don't cross stage boundaries; redeclare so /health reads real provenance at runtime.
ARG COMMIT_SHA="" BUILD_TIME=""
ENV COMMIT_SHA=${COMMIT_SHA}
ENV BUILD_TIME=${BUILD_TIME}

COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ services:
memory: 128M

healthcheck:
test: ['CMD', 'wget', '--quiet', '--tries=1', '--spider', 'http://127.0.0.1:3001/']
test: ['CMD', 'wget', '--quiet', '--tries=1', '--spider', 'http://127.0.0.1:3001/health']
interval: 30s
timeout: 10s
retries: 3
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"verify": "npx tsc --noEmit && next lint && npm run build && vitest run"
},
"dependencies": {
"@agentage/observability": "^0.6.1",
"@agentage/observability": "^0.8.0",
"@vercel/otel": "^2.1.3",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
Expand Down
13 changes: 13 additions & 0 deletions src/app/health/route.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { describe, it, expect } from 'vitest';
import { GET } from './route';

describe('GET /health', () => {
it('reports the v1 envelope for diffractwd-web', async () => {
const res = await GET();
const body = await res.json();

expect(res.status).toBe(200);
expect(body.data.service).toBe('diffractwd-web');
expect(body.data.status).toBe('ok');
});
});
6 changes: 6 additions & 0 deletions src/app/health/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { healthResponse } from '@agentage/observability/health';

// Never prerender, or commit/buildTime are baked at build instead of read from the
// running container.
export const dynamic = 'force-dynamic';
export const GET = () => healthResponse({ service: 'diffractwd-web' });