Prompt Library › ⚙️ Technical › Create Docker and CI/CD Configs with AI
GPT-4o ⚙️ Technical Intermediate

Create Docker and CI/CD Configs with AI

Generate a production-ready Dockerfile and [CI_PLATFORM] pipeline for [APP_TYPE] — with multi-stage builds, caching, and automated deploy to [PLATFORM].

👁 6 views ⎘ 0 copies ♥ 0 likes

The Prompt

# Create Docker and CI/CD Configs with AI

You are a DevOps engineer. Generate a production-ready Dockerfile and [CI_PLATFORM] pipeline config for [APP_NAME].

## Application Details

- **Runtime:** [RUNTIME] [VERSION]
- **Build command:** [BUILD_COMMAND]
- **Start command:** [START_COMMAND]
- **Port:** [PORT]
- **Environment variables:** [ENV_VAR_LIST]

## Dockerfile Requirements

- Use multi-stage build: [BUILD_STAGE] then [RUNTIME_STAGE]
- Base image: [BASE_IMAGE]
- Run as non-root user [USER_NAME]
- Optimize layer caching for [DEPENDENCY_INSTALL_STEP]
- Final image size target: under [MAX_IMAGE_SIZE]MB

## CI/CD Pipeline

Stages:
1. **Test** — run [TEST_COMMAND] on every push to [BRANCH_PATTERN]
2. **Build** — build and push Docker image to [REGISTRY] tagged with [TAG_STRATEGY]
3. **Deploy** — deploy to [DEPLOY_PLATFORM] only on push to [DEPLOY_BRANCH]

## Security

Scan the image with [SCANNER] before pushing. Block the pipeline if [SEVERITY_LEVEL] vulnerabilities are found.

📝 Fill in the blanks

Replace these placeholders with your own content:

[CI_PLATFORM]
[APP_NAME]
[RUNTIME]
[VERSION]
[BUILD_COMMAND]
[START_COMMAND]
[PORT]
[ENV_VAR_LIST]
[BUILD_STAGE]
[RUNTIME_STAGE]
[BASE_IMAGE]
[USER_NAME]
[DEPENDENCY_INSTALL_STEP]
[MAX_IMAGE_SIZE]
[TEST_COMMAND]
[BRANCH_PATTERN]
[REGISTRY]
[TAG_STRATEGY]
[DEPLOY_PLATFORM]
[DEPLOY_BRANCH]
[SCANNER]
[SEVERITY_LEVEL]

How to use this prompt

1
Copy the prompt

Click "Copy Prompt" above to copy the full prompt text to your clipboard.

2
Replace the placeholders

Swap out anything in [BRACKETS] with your specific details.

3
Paste into GPT-4o

Open your preferred AI assistant and paste the prompt to get started.