Pre-built debug containers for diagnosing connectivity, database, and infrastructure issues in DigitalOcean App Platform. Deploys in 30-45 seconds using pre-built images from GitHub Container Registry.
When troubleshooting App Platform issues, you need to answer questions like:
- Can my app reach the database?
- Is DNS resolving correctly?
- Are external APIs accessible?
- What environment variables are available?
These debug containers come fully loaded with all diagnostic tools, eliminating the slow "guess → push → wait 5-7 min → check" debugging cycle.
| Image | Runtime | Use Case |
|---|---|---|
ghcr.io/bikramkgupta/debug-python |
Python 3.x | Python/Django/Flask apps |
ghcr.io/bikramkgupta/debug-node |
Node.js 20.x | Node/Express/Next.js apps |
Both images include identical CLI tools and database clients. Choose based on your app's runtime for native library support.
doctl apps create --spec app-specs/debug-python.yamldoctl apps create --spec app-specs/debug-node.yamlAdd the debug container as a worker component to test connectivity within your app's network:
workers:
- name: debug
image:
registry_type: GHCR
registry: bikramkgupta
repository: debug-python # or debug-node
tag: latest
instance_size_slug: basic-xxs
instance_count: 1
envs:
- key: DATABASE_URL
scope: RUN_TIME
value: ${db.DATABASE_URL}See app-specs/debug-worker-python.yaml or app-specs/debug-worker-node.yaml for complete examples.
| Database | CLI Tool | Environment Variable |
|---|---|---|
| PostgreSQL | psql |
DATABASE_URL |
| MySQL | mysql |
MYSQL_URL |
| Redis/Valkey | redis-cli |
REDIS_URL |
| MongoDB | mongosh |
MONGODB_URI |
| Kafka | kcat |
KAFKA_BROKERS |
| OpenSearch | curl + jq |
OPENSEARCH_URL |
Python image:
psycopg2-binary(PostgreSQL)pymysql(MySQL)redis(Redis/Valkey)pymongo(MongoDB)confluent-kafka,kafka-python-ng(Kafka)opensearch-py(OpenSearch)boto3(Spaces/S3)
Node.js image:
pg(PostgreSQL)mysql2(MySQL)ioredis(Redis/Valkey)mongodb(MongoDB)kafkajs(Kafka)@opensearch-project/opensearch(OpenSearch)@aws-sdk/client-s3(Spaces/S3)
curl,wget- HTTP clientsdig,nslookup- DNS lookupping,traceroute- Network path testingnetcat (nc)- TCP/UDP connectivityss,netstat- Socket statisticsnmap- Network explorationtcpdump- Packet capture
doctl- DigitalOcean CLI (latest version, auto-updated)
Both images include libraries for DigitalOcean Spaces:
- Python:
boto3 - Node.js:
@aws-sdk/client-s3
htop,ps,top- Process monitoringfree,df- Memory and disk usagelsof,strace- Debuggingjq- JSON processingvim,less,tmux- Editors and utilities
When the container starts, it displays available commands and detected database connections in the runtime logs:
================================================================================
DigitalOcean App Platform Debug Container
================================================================================
Runtime: Python
Health Server: http://0.0.0.0:8080
DIAGNOSTIC SCRIPTS:
diagnose.sh Full system diagnostic report
test-db.sh <type> Database connectivity test
test-connectivity.sh Network connectivity test
DETECTED DATABASE CONNECTIONS:
✓ DATABASE_URL is set
✓ REDIS_URL is set
================================================================================
Access the container shell and run:
# Full system diagnostic (memory, disk, network, env vars, database checks)
diagnose.sh
# Test specific database connectivity
test-db.sh postgres # Uses $DATABASE_URL
test-db.sh mysql # Uses $MYSQL_URL
test-db.sh redis # Uses $REDIS_URL (works with Valkey too)
test-db.sh mongodb # Uses $MONGODB_URI
test-db.sh kafka # Uses $KAFKA_BROKERS
test-db.sh opensearch # Uses $OPENSEARCH_URL
# Test DigitalOcean Spaces connectivity
test-spaces.sh # Uses $SPACES_KEY, $SPACES_SECRET, $SPACES_ENDPOINT
# Test network connectivity
test-connectivity.sh https://api.example.com
test-connectivity.sh db.example.com 5432# List your apps
doctl apps list
# Access container shell
doctl apps console <app-id> debugWhen deployed as a service, the container exposes:
| Endpoint | Description |
|---|---|
/ |
Container info and available scripts |
/health |
Health check ({"status": "healthy"}) |
| Variable | Description | Used By |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | test-db.sh postgres |
MYSQL_URL |
MySQL connection string | test-db.sh mysql |
REDIS_URL |
Redis/Valkey connection string | test-db.sh redis |
MONGODB_URI |
MongoDB connection string | test-db.sh mongodb |
KAFKA_BROKERS |
Kafka broker addresses (comma-separated) | test-db.sh kafka |
OPENSEARCH_URL |
OpenSearch endpoint URL | test-db.sh opensearch |
SPACES_KEY |
Spaces access key | test-spaces.sh |
SPACES_SECRET |
Spaces secret key | test-spaces.sh |
SPACES_ENDPOINT |
Spaces endpoint (e.g., nyc3.digitaloceanspaces.com) |
test-spaces.sh |
SPACES_BUCKET |
Bucket name (optional) | test-spaces.sh |
| Error | Cause | Solution |
|---|---|---|
bind: address already in use |
Port conflict | Check PORT env var |
ECONNREFUSED |
Database not attached | Verify database binding in app spec |
Exit code 137 |
Out of memory | Increase instance size |
Health check failed |
App not responding | Debug with this container |
DNS resolution fails |
DNS propagation delay | Wait 1-2 minutes |
# Build Python variant
docker build --target debug-python -t debug-python .
# Build Node.js variant
docker build --target debug-node -t debug-node .Images are automatically built and pushed to GHCR when you:
- Push a version tag (e.g.,
v1.0.0) - Manually trigger the workflow
See .github/workflows/build-and-push.yml.
- Deploy as a worker (not service) in production to avoid public exposure
- Sensitive environment variables are redacted in diagnostic output
- Remove the debug container after troubleshooting is complete
- The container sets
PS1='\u@\h:\w\$ 'for SDK compatibility
.
├── Dockerfile # Multi-stage build (Python & Node.js)
├── health-server/ # Go health server source
│ ├── main.go
│ └── go.mod
├── scripts/
│ ├── startup.sh # Container startup with banner
│ ├── diagnose.sh # Full diagnostic report
│ ├── test-db.sh # Database connectivity tests
│ └── test-connectivity.sh # Network connectivity tests
├── app-specs/
│ ├── debug-python.yaml # Standalone Python service
│ ├── debug-node.yaml # Standalone Node.js service
│ ├── debug-worker-python.yaml # Python worker template
│ └── debug-worker-node.yaml # Node.js worker template
└── .github/workflows/
└── build-and-push.yml # CI/CD for GHCR
MIT