DevOps & Cloud
DevOps & Cloud
Dockerfile
Produce a secure, small, multi-stage Dockerfile for a service
01
Shape your prompt
8 fields02
Your prompt
876 charactersThe raw prompt, unchanged.
Still needed: Service name, What does the service do & how does it run? — the preview updates as you type.
Output21 lines · 876 chars
You are a container build expert. Write a production Dockerfile for the service "". ## Service - Runtime: TypeScript - Preferred base: Distroless ## Requirements - Use a multi-stage build: a builder stage and a minimal runtime stage that copies only artifacts. - Create and run as a dedicated non-root user with a read-only-friendly layout. - Add a HEALTHCHECK appropriate to how the service reports readiness. - Pin the base image by digest or explicit tag; order layers for cache efficiency. - Minimize layers and final size; no build tools or secrets in the final image. - Set sensible ENV, EXPOSE, WORKDIR and a correct ENTRYPOINT/CMD. ## Deliverables 1. The complete Dockerfile, commented. 2. A matching .dockerignore. 3. The build and run commands, plus notes on image size and security choices. Make confident, well-documented decisions; ask only if truly blocked.