You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update the backend Dockerfile to build and run the TypeScript-based backend. Ensure the image compiles TypeScript, runs Prisma migrations if needed, and starts the compiled Node server in a production-appropriate environment.
Tasks
Review the migration roadmap for Docker and build requirements
Update Dockerfile base image to a supported Node LTS version
Configure build stage:
- Set working directory
- Copy package.json, pnpm-lock.yaml, and pnpm config
- Install dependencies with pnpm install --frozen-lockfile
- Copy source files (app/, prisma/, tsconfig.json, etc.)
- Run TypeScript build (pnpm build or npx tsc)
Configure runtime stage:
- Copy compiled output (e.g., dist/) and minimal runtime dependencies
- Copy prisma artifacts if required (e.g., node_modules/.prisma)
- Set environment variables and NODE_ENV=production
- Set CMD to run compiled server entrypoint (e.g., node dist/app/server.js)
Ensure Dockerfile uses .dockerignore to exclude unnecessary files (node_modules, tests, local artifacts)
If using Prisma:
- Optionally run prisma migrate deploy or prisma generate in the image or entry script
Build and run the image locally for verification
Commit Dockerfile changes
Expected Behavior
The Docker image builds the TypeScript backend, runs the compiled server, and supports Prisma and other runtime dependencies in a production context.
Tech Notes
Prefer a multi-stage Docker build to keep the runtime image small.
Align Docker build commands with package.json scripts used for local builds.
Acceptance Criteria
docker build for the backend image completes successfully
Running the container starts the compiled server and serves GraphQL/HTTP endpoints
Container logs show correct startup with TypeScript build artifacts
Test Instructions
Run pnpm test locally before building the image.
Build the Docker image: docker build -t quote-vote-backend:ts .
Run the container: docker run -p 4000:4000 quote-vote-backend:ts
Hit health and GraphQL endpoints from the host to confirm behavior.
Optionally, run a minimal smoke test suite inside the container or against the running container.
7.71 Update Dockerfile for TypeScript Build
Summary
Update the backend Dockerfile to build and run the TypeScript-based backend. Ensure the image compiles TypeScript, runs Prisma migrations if needed, and starts the compiled Node server in a production-appropriate environment.
Tasks
- Set working directory
- Copy
package.json,pnpm-lock.yaml, andpnpmconfig- Install dependencies with
pnpm install --frozen-lockfile- Copy source files (
app/,prisma/,tsconfig.json, etc.)- Run TypeScript build (
pnpm buildornpx tsc)- Copy compiled output (e.g.,
dist/) and minimal runtime dependencies- Copy
prismaartifacts if required (e.g.,node_modules/.prisma)- Set environment variables and
NODE_ENV=production- Set
CMDto run compiled server entrypoint (e.g.,node dist/app/server.js).dockerignoreto exclude unnecessary files (node_modules, tests, local artifacts)- Optionally run
prisma migrate deployorprisma generatein the image or entry scriptExpected Behavior
The Docker image builds the TypeScript backend, runs the compiled server, and supports Prisma and other runtime dependencies in a production context.
Tech Notes
package.jsonscripts used for local builds.Acceptance Criteria
docker buildfor the backend image completes successfullyTest Instructions
pnpm testlocally before building the image.docker build -t quote-vote-backend:ts .docker run -p 4000:4000 quote-vote-backend:tsLabels
backenddockerbuildtypescriptphase7