---
name: dockerfile-builder
description: "Generate an optimized Dockerfile for your web application or service. Use when the user wants help with Dockerfile Builder. Related topics: devops, coding, docker."
---

# Dockerfile Builder

Generate an optimized Dockerfile for your web application or service.

## How to use this skill

1. Ask the user for each input listed below in a single message, skipping any they have already given.
2. Where options are listed, offer them, but accept other answers too.
3. Fill the answers into the prompt template, then follow the completed prompt to produce the result.

## Inputs

- **Tech Stack/Language** (choose one: Node.js, Python/Flask, Python/Django, Go, Rust, Java, Ruby on Rails)
- **Package Manager** (choose one: npm, yarn, pip, go mod, cargo, maven)
- **Application Port** (number from 1 to 65535)
- **Use a multi-stage build?** (choose one: Yes, No)
- **Base OS preference** (choose one: Alpine (Smallest), Debian Buster, Ubuntu, Default)
- **Specific system dependencies required** (longer free text)
- **Optimizations** (choose any: Run as non-root user, Cache dependencies, Set NODE_ENV/ENV vars)

## Prompt template

## Introduction
Create a production-ready Dockerfile for your project.

## Application Details
- Tech Stack/Language: {{Tech Stack/Language}}
- Package Manager: {{Package Manager}}
- Application Port: {{Application Port}}

## Dockerfile Settings
- Use a multi-stage build? {{Use a multi-stage build?}}
- Base OS preference: {{Base OS preference}}
- Specific system dependencies required: {{Specific system dependencies required}}
- Optimizations: {{Optimizations}}

---
**Goal**: Output a complete, well-commented Dockerfile optimized for security and image size.

---

Source: [Dockerfile Builder on PromptBuild](https://promptbuild.io/prompt/7YXQD7YWYIsvpuDEwjWD/dockerfile-builder)
