- Add incident reporting routes and logic to handle creation, updating, and retrieval of incidents. - Implement visibility rules for users based on roles (reporters, supervisors). - Create tests for incident reporting functionality to ensure correctness and reliability. - Introduce site and area management routes, including validation for area hierarchy. - Establish user management routes with role-based access control for creating and updating users. - Add setup routes for initializing the application with an organization and admin user. - Implement shared enums and schemas for consistent validation and data handling across the application. - Create a test helper for setting up an in-memory database and API client for testing. - Add TypeScript configuration for server-side code with strict type checking and module resolution.
35 lines
940 B
YAML
35 lines
940 B
YAML
# Production setup: the app plus PostgreSQL.
|
|
# cp .env.example .env # set POSTGRES_PASSWORD (and PUBLIC_URL if not localhost)
|
|
# docker compose up -d
|
|
# Then open http://localhost:3000 and complete first-run setup.
|
|
|
|
services:
|
|
db:
|
|
image: postgres:18-alpine
|
|
environment:
|
|
POSTGRES_USER: safetylog
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}
|
|
POSTGRES_DB: safetylog
|
|
volumes:
|
|
- db-data:/var/lib/postgresql
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U safetylog -d safetylog"]
|
|
interval: 5s
|
|
retries: 10
|
|
restart: unless-stopped
|
|
|
|
app:
|
|
build: .
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
DATABASE_URL: postgres://safetylog:${POSTGRES_PASSWORD}@db:5432/safetylog
|
|
PUBLIC_URL: ${PUBLIC_URL:-http://localhost:3000}
|
|
ports:
|
|
- "${PORT:-3000}:3000"
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
db-data:
|