home / skills / aaaaqwq / agi-super-skills / docker-deployment
/skills/backend/docker-deployment
This skill helps you deploy web apps with Docker, secure Nginx HTTPS, and connect via Cloudflare Tunnel for secure external access.
npx playbooks add skill aaaaqwq/agi-super-skills --skill docker-deploymentReview the files below or copy the command above to add this skill to your agents.
---
name: docker-deployment
description: Docker container deployment with Nginx HTTPS configuration and Cloudflare Tunnel integration. Use when deploying web applications with Docker, configuring SSL/TLS certificates, setting up Nginx reverse proxy, or integrating with Cloudflare Tunnel for secure external access.
license: MIT
---
# Docker Deployment with Nginx HTTPS
## Quick Start
For Docker web application deployment with HTTPS support:
1. **Configure Nginx** with SSL certificates (see [nginx-https.md](references/nginx-https.md))
2. **Set up docker-compose.yml** with certificate volume mounting
3. **Configure Cloudflare Tunnel** to connect external domain to local container
## Common Tasks
| Task | Reference |
|------|-----------|
| Nginx HTTPS configuration | [nginx-https.md](references/nginx-https.md) |
| Cloudflare Origin Certificate | [cf-origin-cert.md](references/cf-origin-cert.md) |
| Docker data persistence | [data-persistence.md](references/data-persistence.md) |
| Cloudflare Tunnel setup | [cf-tunnel.md](references/cf-tunnel.md) |
## Architecture Overview
```
Internet → Cloudflare Edge (HTTPS) → Cloudflare Tunnel → Ubuntu/Docker (Nginx)
```
## Key Principles
- **Always use named Docker volumes** for persistent data
- **Nginx should redirect HTTP (80) to HTTPS (443)** in production
- **Cloudflare Origin Certificates** are for CF-to-origin encryption only
- **Tunnel connects to HTTP or HTTPS** - configure based on nginx setup
## Troubleshooting
**HTTPS not working after enabling Cloudflare force HTTPS?**
- Check if nginx listens on port 443
- Verify SSL certificates are mounted correctly
- Ensure Cloudflare Tunnel service URL matches (http:// or https://)
**Data lost after container restart?**
- Check docker-compose.yml uses named volumes, not bind mounts for critical data
- Verify database path points to mounted volume directory
See individual reference files for detailed solutions.
This skill automates Docker container deployment for web applications with an Nginx reverse proxy, HTTPS configuration, and optional Cloudflare Tunnel integration. It streamlines certificate mounting, redirect rules, and persistent volume handling so services remain secure and recoverable. Use it to deploy production-ready containers behind Cloudflare or directly on a public host.
The skill generates and validates docker-compose setups that mount SSL certificates into Nginx and define named volumes for persistent data. It configures Nginx to redirect HTTP to HTTPS, binds the appropriate ports, and provides options to expose the service to the internet via a Cloudflare Tunnel. It also includes checks for certificate presence, Nginx listening ports, and tunnel service URL consistency.
Why is HTTPS failing after enabling Cloudflare Force HTTPS?
Verify Nginx is listening on port 443 and that the SSL certificate files are correctly mounted into the container. Also confirm the Tunnel service URL matches the protocol (http:// vs https://).
How do I avoid losing data when containers restart?
Use named Docker volumes in docker-compose.yml for databases and important storage paths. Avoid relying on ephemeral container files or anonymous volumes.