Docker Containerization
A container packages your service; it does not change how the service works. The image needs the application, generated protobuf code, production dependencies and a compatible runtime.
Three checks before deployment
- Can it execute the application? Native
.tson Node.js requires ≥25.2.0; compiled JavaScript and tsx follow the package floor, ≥22.13.0. A production tsx launch needs tsx in production dependencies. - Does the probe speak the right protocol? A plaintext h2c listener needs an HTTP/2-capable probe, not an HTTP/1.1-only health check.
- Can it stop cleanly? Deliver the termination signal and leave time for drain.
Go deeper
- Build the image, configure probes and avoid startup downloads.
- Configure runtime and dependency variants.
- Deploy the image to Kubernetes.
Find a section from the full guide
The detailed material is preserved on a separate page. Earlier section links still work here.
- Multi-Stage Dockerfile
- Recommended Layout
- HEALTHCHECK on a Plaintext h2c Server
- Runtime Command
- Alpine Variant (Node.js Images)
- Node.js Base Image Choices
- .dockerignore
- Docker Compose for Local Development
- OTel Collector Configuration
- Image Optimization Tips
- 1. Layer Caching
- 2. Production Dependencies Only
- 3. Prune Unnecessary Files
- 4. Use .dockerignore Aggressively
- 5. Pin Base Image Digests in Production
- Runtime Configuration
- What's Next