Description:
The current docker-compose.yml only starts a Postgres container, leaving developers to manually start the Express API and Next.js web app in separate terminals with hand-crafted environment variables. Adding api and web service definitions makes docker compose up the single command needed to run the entire TariffShield stack locally, eliminating environment drift between developers.
Acceptance Criteria:
Relevant Files:
docker-compose.yml — add api and web services
apps/api/Dockerfile — new multi-stage Dockerfile for the Express API
apps/web/Dockerfile — new multi-stage Dockerfile for the Next.js app
.env.example — update DATABASE_URL to use Compose service hostname
package.json — npm workspace root confirming workspace paths
Description:
The current
docker-compose.ymlonly starts a Postgres container, leaving developers to manually start the Express API and Next.js web app in separate terminals with hand-crafted environment variables. Addingapiandwebservice definitions makesdocker compose upthe single command needed to run the entire TariffShield stack locally, eliminating environment drift between developers.Acceptance Criteria:
apiservice todocker-compose.ymlthat builds from a newapps/api/Dockerfile, exposes port3001, depends on thepostgresservice, and injects all variables from.env.exampleviaenv_filewebservice that builds from a newapps/web/Dockerfile, exposes port3000, and passesNEXT_PUBLIC_API_URL=http://api:3001so it reaches the API container by service namedepsstage that installs npm workspaces, abuildstage, and a leanrunnerstage usingnode:20-alpinedocker compose up --buildfrom the repo root starts Postgres, API, and web with no additional steps and the web UI is reachable athttp://localhost:3000apiandwebservices mount the source directory as a volume whenNODE_ENV=development.env.examplewith aDATABASE_URLthat matches the Compose service name (postgres://...@postgres:5432/tariffshield)README.mdunder a "Local Development" sectionRelevant Files:
docker-compose.yml— addapiandwebservicesapps/api/Dockerfile— new multi-stage Dockerfile for the Express APIapps/web/Dockerfile— new multi-stage Dockerfile for the Next.js app.env.example— updateDATABASE_URLto use Compose service hostnamepackage.json— npm workspace root confirming workspace paths