> For the complete documentation index, see [llms.txt](https://docs.warp.dev/llms.txt).
> Markdown versions of each page are available by appending .md to any URL.

# Create and verify a Docker setup

Use agents in Warp to create a Docker setup for your application, then build and test it locally before deployment.

Learn how to use Warp’s coding agent to containerize your application, then build and test the application locally.

![Creating a production-ready Docker setup with Warp video](https://i.ytimg.com/vi/zdQdEauSF6Q/sddefault.jpg)

Warp’s AI can analyze your codebase and generate **Dockerfiles**, **.dockerignore**, and **docker-compose.yml**. Review the generated files for your application’s dependencies, startup commands, networking, and secret handling before building the image.

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

1.  #### 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.
    
2.  #### The prompt
    
    Use this prompt inside Warp’s AI input:
    
    ```text
    "Analyze my project directory structure, package files, and configuration to propose a Docker setup for review. 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
    
    Explain your assumptions and the commands needed to build and test this application. Stop with the diff for my review; do not deploy or push an image."
    ```
    
    Check the detected framework, required services, and startup command against your application’s configuration.
    
3.  #### Review and customize
    
    Review the generated files for:
    
    -   Base image version and vulnerability findings
    -   Build layer caching
    -   Build and runtime dependencies
    -   Environment variables and secret handling
    
    You can easily adjust service names or ports in the generated compose file.
    
    Run `docker compose config` to validate the Docker Compose configuration. Follow the build and startup instructions to build the images and run the application locally. Run the relevant application test and exercise a key user flow or API endpoint to check that the containerized application behaves as expected.
    
    Before deploying, review the configuration against your environment’s security access and recovery requirements.
