TypeScript service image
Your task
Build a production image for a small TypeScript API. The build output is created under dist/, and the runtime container runs that output. What to do: complete Dockerfile. Note: build with npm run build and run with node dist/server.js.
Ground rules
- •Use lockfile-based install.
- •Include build output and package files in the final image.
Not required
- •Source map upload.
- •Image vulnerability scanner integration.
▶About this challenge
Configure a production image for a small compiled service by separating the build step from the run step.
Production images should distinguish tools needed to create output from files needed to run the service.
- What does this practice?
- It practices splitting build and runtime concerns in an application image.
- Why separate the steps?
- To avoid leaving unnecessary files and tools in the runtime environment.