Skip to content

About

A reverse proxy for Docker containers that uses mDNS to provide .local domain names for your services. It automatically discovers and configures itself based on container labels, allowing you to access services running in Docker containers using friendly hostnames instead of IP addresses.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

17 Commits

Folders and files

Repository files navigation

localdomain

A Go-based project for local network service discovery and management.

Features

  • Service discovery using mDNS
  • Command-line interface (CLI) for starting and managing services
  • Docker support for easy deployment

Project Structure

  • main.go: Entry point for the application
  • cmd/: CLI commands
    • root.go: Root command definition
    • start.go: Start command implementation
  • mdns/: mDNS responder implementation
  • testservice/: Example/test service with its own Docker Compose setup
  • Dockerfile: Container build instructions
  • docker-compose.yml: Multi-service orchestration

Getting Started

Prerequisites

  • Go 1.18+
  • Docker (for containerized usage)

Build and Run (Locally)

go build -o localdomain
./localdomain

Using Docker

Build and run the container:

docker build -t localdomain .
docker run --rm -it localdomain

Or use Docker Compose:

docker-compose up --build

CLI Usage

Run the CLI with available commands:

./localdomain start

Development

Using Docker Labels

To enable service discovery and proxying with this repository, your Docker containers must be started with specific labels:

  • localdomain.enabled=true — Enable localdomain integration for the container
  • localdomain.hostname=your-service.local — The mDNS hostname to advertise (must end with .local)
  • localdomain.port=8080 — The internal port your service listens on (used for proxying)

Example: Docker Compose Service

services:
  myservice:
    image: myimage
    labels:
      - "localdomain.enabled=true"
      - "localdomain.hostname=myservice.local"
      - "localdomain.port=8080"
    ports:
      - "8080:8080"

Example: Docker Run

docker run -d \
  --label localdomain.enabled=true \
  --label localdomain.hostname=myservice.local \
  --label localdomain.port=8080 \
  -p 8080:8080 \
  myimage

The start command will automatically detect containers with these labels, advertise their hostnames via mDNS, and proxy requests to the correct container and port.

About

A reverse proxy for Docker containers that uses mDNS to provide .local domain names for your services. It automatically discovers and configures itself based on container labels, allowing you to access services running in Docker containers using friendly hostnames instead of IP addresses.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages