product:containers

Table of contents

  1. Introduction
  2. Reading the output
  3. Listing a deployment
  4. Reference
  5. See also

Introduction

product:containers shows the containers of your product and of all its features, with their state and ports. It also gives you the URLs to open, the endpoints to connect to, and how the port offset shifted each port. It needs a selected product (SPLENT_APP).

splent product:containers
my_first_app  [dev]

  SOURCE                             SERVICE                        STATUS         PORTS
  ──────────────────────────────────────────────────────────────────────────────────────────
  splent_feature_cache@v1.5.6        splent_feature_cache           running 6971→6379
  splent_feature_proxy@v1.0.0        splent_feature_proxy           running 671→80
  splent_feature_mailcatcher@v1.0.7  splent_feature_mailcatcher     running 1616→1025, 8616→8025
  my_first_app                       my_first_app_db                running 33651→3306
  my_first_app                       my_first_app_web               running 5591→5000

  Accessible services:
  ──────────────────────────────────────────────────────────────────────────────────────────
    splent_feature_proxy@v1.0.0   http://localhost:671
    Mailhog                       http://localhost:8616
    App                           http://localhost:5591

  Connection endpoints:
  ──────────────────────────────────────────────────────────────────────────────────────────
    Redis                         localhost:6971
    Mailhog SMTP                  localhost:1616
    MariaDB                       localhost:33651

  Port offset: +591
  crc32("my_first_app") % 1000 = 591

    SERVICE                    BASE  OFFSET    HOST  CONTAINER
    ─────────────────────────────────────────────────────────────
    splent_feature_cache       6380    +591    6971  → 6379
    splent_feature_proxy         80    +591     671  → 80
    splent_feature_mailcatcher 1025    +591    1616  → 1025
    splent_feature_mailcatcher 8025    +591    8616  → 8025
    my_first_app_db           33060    +591   33651  → 3306
    my_first_app_web           5000    +591    5591  → 5000

Reading the output

Section Shows
Table Where each container comes from (the feature or the product), its service, its state and its ports. Green is running or healthy, yellow starting or restarting, red exited or unhealthy
Accessible services What you can open in a browser. Flask on 5000 is App, a Mailhog UI on 8025 is Mailhog, and nginx or phpMyAdmin on 80 go by their name. Any other service on 80, 443, 8080, 3000 or 4000 shows under its source
Connection endpoints Redis, MariaDB, PostgreSQL, MongoDB and SMTP as localhost:PORT, for a database client and the like
Port offset crc32(<product>) % 1000, and for each port its base, the offset, the host port and the container port

A host port no larger than the offset cannot have been shifted, so its offset shows as a dash.


Listing a deployment

splent product:containers --prod

With --prod it reads the deploy bundle’s deploy/docker-compose.yml, project <product>_deploy, with deploy/.env. A product without one is listed per stack, as in dev, from the prod compose files.

Without --dev or --prod it asks the running <product>_web container for its SPLENT_ENV, and takes dev when that container is not running, does not answer within 3 seconds, or says neither dev nor prod. That probe never looks at <product>_web_deploy, so pass --prod to list a deployment.


Reference

Option Description
--dev List the development stacks
--prod List the deployment
Message Meaning
No containers found for <product> (<env>). Is it up? Nothing is running. Start it with splent product:up
docker did not answer within 30s (...) The Docker daemon is stuck. The command exits 1
docker not found. Install Docker and make sure it is on your PATH. No Docker here. The command exits 1

See also


Back to top

splent. Distributed by an LGPL license v3. Contact us: drorganvidez@us.es