SDL Networking

Expose ports and configure networking for your deployments.

Port Exposure

expose:
  - port: 80          # Container port
    as: 80            # External port
    to:
      - global: true  # Internet accessible
  - port: 443
    as: 443
    to:
      - global: true

Port Configuration Options

FieldDescription
portContainer internal port (where your app listens)
asExternal port number (what users connect to)
to.globalIf true, accessible from internet via deployment URL

Common Port Configurations

Web Server (HTTP/HTTPS)

expose:
  - port: 80
    as: 80
    to:
      - global: true

Node.js API

expose:
  - port: 3000
    as: 3000
    to:
      - global: true

Multiple Ports

expose:
  - port: 80
    as: 80
    to:
      - global: true
  - port: 443
    as: 443
    to:
      - global: true
  - port: 8080
    as: 8080
    to:
      - global: true

Internal Service Communication

Services within the same deployment can communicate using service names:

services:
  api:
    image: node:20-alpine
    expose:
      - port: 3000
        as: 3000
        to:
          - global: true
    env:
      - REDIS_HOST=cache    # Uses service name

  cache:
    image: redis:alpine
    # No expose needed - only internal access

Services without global: true are only accessible from other services in the same deployment. Use Docker's internal DNS (service name as hostname) for inter-service communication.

Deployment URLs

When your deployment starts, it gets a URL like:

https://web-17628738.deployments.kovanetwork.com

The format is: {service}-{deployment-id}.deployments.kovanetwork.com