mirror of
https://github.com/hanzoai/analytics.git
synced 2026-10-30 15:05:29 +00:00
The route tree moves from src/app/api to src/app/v1, and every caller moves with it: the dashboard's useApi base, the tracker and recorder collect paths, the Next headers and rewrites, the container middleware, the compose healthchecks and the Cypress API tests. The /v1/analytics alias is gone; /v1 is the one prefix. The build-time telemetry post to an upstream endpoint nothing serves is deleted. v1-surface.test.ts fails if src/app/api returns or any first-party file names an /api/ path. Claude-Session: https://claude.ai/code/session_011i2AG9nwpiKUCVxAdDzYuU
52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
---
|
|
version: '3'
|
|
services:
|
|
analytics:
|
|
build: ../
|
|
ports:
|
|
- '3001:3000'
|
|
environment:
|
|
DATABASE_URL: postgresql://analytics:analytics@db:5432/analytics
|
|
DATABASE_TYPE: postgresql
|
|
APP_SECRET: replace-me-with-a-random-string
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
restart: always
|
|
healthcheck:
|
|
test: ['CMD-SHELL', 'curl http://localhost:3000/v1/heartbeat']
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
db:
|
|
image: postgres:15-alpine
|
|
environment:
|
|
POSTGRES_DB: analytics
|
|
POSTGRES_USER: analytics
|
|
POSTGRES_PASSWORD: analytics
|
|
volumes:
|
|
- analytics-db-data:/var/lib/postgresql/data
|
|
restart: always
|
|
healthcheck:
|
|
test: ['CMD-SHELL', 'pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}']
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
cypress:
|
|
image: 'cypress/included:13.6.0'
|
|
depends_on:
|
|
- analytics
|
|
- db
|
|
environment:
|
|
- CYPRESS_baseUrl=http://analytics:3000
|
|
- CYPRESS_admin_user=admin
|
|
- CYPRESS_admin_password=analytics
|
|
volumes:
|
|
- ./tsconfig.json:/tsconfig.json
|
|
- ../cypress.config.ts:/cypress.config.ts
|
|
- ./:/cypress
|
|
- ../node_modules/:/node_modules
|
|
- ../src/lib/crypto.ts:/src/lib/crypto.ts
|
|
volumes:
|
|
analytics-db-data:
|