Fix Docker build: compile TS packages for runtime #38

Merged
ghost merged 1 commits from fix/docker-ts-build into main 2026-03-18 01:34:26 +00:00
ghost commented 2026-03-18 01:32:58 +00:00 (Migrated from github.com)

Summary

  • The API Docker image copied raw .ts source for @groombook/db and @groombook/types into the runtime stage
  • tsx (TypeScript loader) is a devDependency, stripped by --prod install
  • Node.js fails with ERR_UNKNOWN_FILE_EXTENSION for .ts files at startup

Changes

  • Added build scripts to packages/db and packages/types
  • Added outDir: ./dist to packages/types/tsconfig.json
  • Updated main fields to ./dist/index.js in both packages
  • Dockerfile now builds packages in dependency order (types → db → api)
  • Runtime stage copies only compiled dist/ output

Test plan

  • CI passes
  • Docker build completes successfully
  • API container starts without TypeScript errors
  • API connects to postgres and serves requests

🤖 Generated with Claude Code

## Summary - The API Docker image copied raw `.ts` source for `@groombook/db` and `@groombook/types` into the runtime stage - `tsx` (TypeScript loader) is a devDependency, stripped by `--prod` install - Node.js fails with `ERR_UNKNOWN_FILE_EXTENSION` for `.ts` files at startup ### Changes - Added `build` scripts to `packages/db` and `packages/types` - Added `outDir: ./dist` to `packages/types/tsconfig.json` - Updated `main` fields to `./dist/index.js` in both packages - Dockerfile now builds packages in dependency order (types → db → api) - Runtime stage copies only compiled `dist/` output ## Test plan - [ ] CI passes - [ ] Docker build completes successfully - [ ] API container starts without TypeScript errors - [ ] API connects to postgres and serves requests 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This repo is archived. You cannot comment on pull requests.