Skip to main content

SERVICE_KEY_RFC1123

Service keys (service names) in your Compose file must comply with RFC1123 naming conventions. This is because these names are used for DNS resolution within Portway. While Docker Compose itself does not strictly require service names to be RFC1123-compliant, using names that do not follow this standard can lead to DNS resolution issues and unpredictable behavior in distributed environments. To improve reliability and make debugging easier, Portway enforces RFC1123 compliance for all service names. RFC1123-compliant names:
  • Must consist of lower-case alphanumeric characters or -
  • Must start and end with an alphanumeric character
  • Must be no longer than 63 characters
If your service name does not meet these requirements, you will receive the SERVICE_KEY_RFC1123 validation code.
services:
  my_service: { ... } 
  my-service: { ... } 

IMAGE_VERSION_NOT_SPECIFIED

If you specify an image for a service in your Compose file but do not include a version tag (e.g., :latest, :1.2.3), Portway will return the IMAGE_VERSION_NOT_SPECIFIED validation code. This helps ensure that your deployments are reproducible and predictable, as omitting a version tag can lead to unexpected updates when the image is rebuilt or changed upstream.
services:
  my-service:
    image: my-image
    image: my-image:1.0.0

ONLY_VOLUME_TYPE_ALLOWED

When defining volumes for a service in your Compose file, only volumes of type volume are supported by Portway. If you specify a volume of another type (such as bind or tmpfs), you will receive the ONLY_VOLUME_TYPE_ALLOWED validation code. This restriction ensures portability and security, as bind mounts and other volume types may not be supported or may behave unpredictably in cloud environments. What to do:
  • Use only named volumes (type volume) in your volumes section.
  • If you need to include files or directories, consider adding them to your image during the build process.
Example:
services:
  my-service:
    volumes:
      - type: bind
      - type: volume

IMPLICIT_ROOT_URL_PATH

If you have multiple services in your Compose file and do not specify a path for any of them, Portway will return the IMPLICIT_ROOT_URL_PATH validation code. This helps ensure that your services are properly routed and that there are no conflicts with other services. Example:
services:
  service-a:
    # ...
    labels:
      portway.route.path: /
  service-b:
    # ...
    labels:
      portway.route.path: /service-b

SERVICE_PORT_VALIDATION

When you define a route for a service using portway.route.port, Portway validates that the service has a valid port configuration. This validation ensures that your service can be properly routed and accessed. Common issues:
  1. Missing port configuration: If you specify a route port but don’t define any ports for the service, you’ll get an error.
  2. Implicit port detection: If Portway has to guess which port to use (because you didn’t explicitly define one), you’ll get a warning.
What to do:
  • Always explicitly define ports in your service configuration when using routing labels.
  • Use the ports section to specify which ports your service exposes.
Example:
services:
  my-service:
    labels:
      portway.route.port: /