Skip to content

Setting up a client installation

Each client gets its own copy of the application. Nothing is shared between clients: not the database, not the files, not the network.

A folder is created per client with the same base content: the compose.yaml, the variables template and the code. What changes is the .env file and, later, the company data in Settings › Company.

The variable that tells everything apart is CLIENTE. With it, the containers are called <cliente>-api and <cliente>-db, the volumes <cliente>-pgdata and <cliente>-archivos, and the network <cliente>-net. Without it, everything would be called organtia and two clients would collide.

Variable What it is for Example
CLIENTE Short client name: it names the containers, volumes and network acme
RED_SUBNET That installation’s own subnet (two installations cannot share it) 10.99.43.0/24
API_PORT Local port where the api listens (loopback only) 18012
DB_PORT_HOST Local PostgreSQL port for the tests 54330
DB_NAME, POSTGRES_USER, POSTGRES_PASSWORD That client’s database —
ACCESO_CLAVE Initial password for the office door —
ACCESO_DIAS Days the session lasts before asking for the password again 7
TZ Time zone of the installation and its cron jobs Europe/Madrid
MARCA, CLIENTE Product name and short installation name Acme
EMPRESA, CEO_NOMBRE, LEGAL Seed for the company data: first time only

The image is built once and started. The same image serves every client: what changes is the configuration.

On the first startup the tables are created, the migrations are applied and the owner user is created with the password from ACCESO_CLAVE.

Each client has its own address, of the form nombre_cliente.organtia.com. In the proxy you add a block that:

  1. Listens on that name.
  2. Requests the HTTPS certificate automatically.
  3. Forwards to that installation’s api, on its local port.

Nothing else is exposed: the database and the files have no door to the internet.

  • Open the address and sign in with the owner user.
  • Check that the office has the staff seated.
  • Request a small assignment and see it delivered.
  • Look at the log: the sign-in entry and the assignment should both be there.

The api image is rebuilt and started again. Pending migrations apply on their own. Tests are run beforehand, in a separate container, against a disposable database.

  • It does not make backups: the server’s backup system does, daily, over the volumes. The application keeps no backups of its own.
  • It does not update itself: updates are decided and run by hand.