# Source: https://docs.warp.dev/university/developer-workflows/devops/how-to-create-a-production-ready-docker-setup.md

# How To: Create a Production Ready Docker Setup

Learn how to use Warp’s AI to automatically build a clean, multi-stage Docker setup for both development and production.

{% embed url="<https://youtu.be/zdQdEauSF6Q?si=CoOdDjiffiw-et6r>" %}

This tutorial shows how to create a **complete Docker environment** in minutes using Warp.\
Warp’s AI can analyze your entire codebase, generate **Dockerfiles**, **.dockerignore**, and **docker-compose.yml** — all optimized for small image size and multi-service orchestration.

Although this example uses a generic web app, the same pattern applies to **Python**, **Node.js**, **Go**, and other ecosystems.

{% stepper %}
{% step %}
**The Challenge**

You’ve built your app and suddenly realize — it should have been containerized from the start.\
Manually configuring Docker files, image sizes, and environment variables takes time and breaks flow.
{% endstep %}

{% step %}
**The Prompt**

Use this prompt inside Warp’s AI input:

{% code overflow="wrap" %}

```
"Analyze my entire project directory structure, package files, and configuration to generate a complete production-ready Docker setup. I need:

A multi-stage Dockerfile optimized for my specific language/framework with proper layer caching, security best practices, and minimal image size
A docker-compose.yml for both development and production environments with all necessary services, networks, volumes, and environment variable handling
A comprehensive .dockerignore file that excludes unnecessary files but keeps what's needed for the build
Startup scripts and health check configurations
Documentation explaining each Docker command and why specific choices were made

Please detect my project type automatically and configure everything accordingly. Include comments explaining the optimization decisions."

```

{% endcode %}

Warp will detect frameworks, infer services, and produce a ready-to-run setup.
{% endstep %}

{% step %}
**Review and Customize**

Warp outputs:

* Optimized base images
* Cached build layers
* Correct dependency stages
* Unified environment management

You can easily adjust service names or ports in the generated compose file.
{% endstep %}
{% endstepper %}