make docker-up

Introduction

make docker-up makes sure the workspace .env is right, then starts the CLI container without entering it. Use it in a script, or to apply your changes to docker-compose.yml.

make docker-up
๐Ÿฉบ SPLENT CLI pre-flight
  ...
โœ… Pre-flight passed.

๐Ÿณ Starting containers...
๐Ÿณ Using UID=1000 GID=1000

What it runs

  1. env-prepare creates or repairs ../.env.
  2. The host pre-flight checks Docker, Compose, gitconfig and ssh, and validates the whole .env.
  3. _drop-legacy-cli moves a legacy CLI container into the splent_cli Compose project. It acts only when splent_cli_container or splent_network belongs to another project, and then prints ๐Ÿงน Moving the CLI container and network to the splent_cli Compose project.... The container keeps no state, since the workspace is a bind mount, so it is removed and the next step creates it again. The network is recreated too, unless running products still use it.
  4. Starts the stack with your UID and GID, so the files the container creates belong to you, not root.
HOST_UID=<uid> HOST_GID=<gid> docker compose -f docker/docker-compose.yml up -d

Running commands in the container

The container runs as the splent user under an init that reaps what each docker exec leaves behind.

A docker exec without -u splent runs as root. Its Python bytecode then goes to /tmp/splent-root-pycache, outside your working copies. Pass -u splent all the same, so everything else a command writes belongs to you.

docker exec -u splent -w /workspace splent_cli_container splent product:list

See also


Back to top

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