claim/docker-compose.claim.yml
Syazwan ef25759eda Fix attachment auto-print, persist cell format, migrate to Bun, 1-click launch
Print bug: remove hidden-iframe auto-print in printAttachment that fired the
OS print dialog on iframe.onload; open attachment in a new tab instead so
print only happens on an explicit Ctrl+P. Drop now-dead printIframeRef/cleanupPrintFrame.

Cell format persistence: new CellFormatToolbar + cellFormat.js save the last
saved per-claim-type header/item format to localStorage; new claims and added
rows inherit it so users don't re-size/re-bold each time. Backend
cell_format_service renders _cellFormat in Excel/PDF.

Bun migration: replace Node/yarn with Bun for the frontend build.
Dockerfile uses oven/bun:1-alpine; bun.lock replaces yarn.lock/package-lock.json;
start.bat files use bun. Frontend dev uses relative baseURL + craco proxy on
port 5000 (avoids CORS and the Grafana conflict on 3000).

1-click launch: root start.bat boots backend (uvicorn :8002) and frontend
(craco :5000) in child windows and opens the browser.

Repo cleanup: remove Node/yarn lockfiles, cursor sync scripts, stray test
reports/PDFs, root package.json/requirements.txt duplicates.

Backend services: claim_document_storage, payslip_storage,
pdf_company_extractor; attachment filenames normalized from PDF text.

Security: gitignore now excludes docker/local env files (with .env.example
allowed) so the live JWT secret cannot be committed.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-07 17:55:11 +08:00

45 lines
1.2 KiB
YAML

# Claim App — local Docker Desktop stack.
# MongoDB runs as a Windows service on the host, so the backend reaches it
# via host.docker.internal:27017.
services:
backend:
build:
context: .
dockerfile: backend/Dockerfile
image: claim-backend:local
container_name: claim-backend
restart: unless-stopped
working_dir: /app/backend
command: ["python", "-m", "uvicorn", "server:app", "--host", "0.0.0.0", "--port", "8002"]
env_file: ./backend/.env
environment:
MONGO_URL: mongodb://host.docker.internal:27017
DB_NAME: claim
PORT: "8002"
FRONTEND_URL: http://localhost:8080
CORS_ORIGINS: http://localhost:8080
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- "./Claim Template:/app/Claim Template:ro"
- claim_uploads:/app/backend/claim_files
- claim_attach:/app/backend/claim_attachments
ports:
- "8002:8002"
frontend:
build:
context: .
dockerfile: frontend/Dockerfile
image: claim-frontend:local
container_name: claim-frontend
restart: unless-stopped
ports:
- "8080:80"
depends_on:
- backend
volumes:
claim_uploads:
claim_attach: