Dokploy / Dokploy/dokploy

Auto-detect and suggest `expose` ports from docker-compose files in `Container Port configuration`

Open
#2,628 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
37.4k
Forks
3k
Avg merge
1d 3h
Merged PRs (30d)
73

Description

What problem will this feature address?

Currently, users must manually enter container ports when configuring domains, which can lead to:

  • Security risks: Users may inadvertently use ports values that expose services to the entire host
  • Configuration errors: Manual port entry increases chances of typos and mismatched ports
  • Poor UX: No guidance on which ports are actually available in the container
  • Inconsistent practices: No encouragement to follow Docker security best practices
Describe the solution you'd like

Auto-detection of expose directive:

  • Parse docker-compose.yml files to extract expose port values
  • Display detected ports as primary options in the Container Port dropdown
  • Show visual indicators (badges/icons) for auto-detected vs manual ports
  • Add informational tooltip explaining the security benefits of expose over ports

Enhanced UI:

Container Port: [Dropdown with detected ports as top options]
┌─ 3000 (from expose) ✓ [Recommended]
├─ 8080 (from expose) ✓ [Recommended]  
├─ ─────────────────────
├─ Custom port...
└─ ⚠️ Note: Avoid using 'ports' values (exposes to host network)

Benefits:

  • Improved security by default
  • Reduced configuration errors
  • Better developer experience
  • Promotes Docker best practices
Describe alternatives you've considered
  1. Parse both expose and ports: Show both but mark ports with warnings - adds complexity without clear benefit
  2. Container inspection: Runtime detection of exposed ports - requires container to be running first
Additional context

Technical considerations:

  • YAML parsing already exists in Dokploy for docker-compose handling
  • Feature should gracefully handle missing expose directives
  • Consider multi-service compose files (detect per service)
  • Maintain backward compatibility with manual port entry

Security impact:
This feature aligns with Docker security best practices by encouraging the use of expose (container-to-container communication) over ports (host exposure), reducing the attack surface of deployed applications.

Similar implementations:
Docker Desktop and Portainer show similar port detection features, validating the usefulness of this approach.

Will you send a PR to implement it?

Maybe, need help

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Container Port configuration entry point and the existing docker-compose YAML parsing used for compose handling. Trace how services and ports are currently represented, then define completion as per-service expose ports appearing as recommended dropdown options while manual entry remains available and missing expose directives are handled gracefully. Add or update coverage for multi-service compose files and the no-expose case.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker-compose, typescript
Domain
devops, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.