Shared services
Podmaker runs shared services on your servers:
| Service | Each app gets | Backups |
|---|---|---|
| PostgreSQL 18 | its own database and role | yes |
| MySQL 8.4 | its own database and user (max 30 connections) | not yet |
| MariaDB 11.8 | its own database and user | not yet |
| MongoDB 8.0 | its own database and a user that owns only it | not yet |
| Redis 8 | its own ACL user, limited to its key prefix | — |
| RabbitMQ 4.1 | its own virtual host and user | — |
| Meilisearch 1.15 | an API key limited to its own indexes (<prefix>_*) |
— |
podmaker service types lists them; more are coming, and you will be able to
add your own (see Your own services below).
Projects connect to them through bindings. A binding creates
credentials for one environment and injects them as variables.
app-01
├─ imp-svc-postgres-main (PostgreSQL, shared)
│ ├─ database shop_staging user shop_staging ← binding "db" of shop/staging
│ └─ database blog_staging user blog_staging ← binding "db" of blog/staging
├─ imp-svc-redis-main (Redis, shared; ACL per key prefix)
└─ Docker network imp-services (private, no published ports)
Shared or dedicated
| Shared | Dedicated | |
|---|---|---|
| What | one instance, a database/user (PostgreSQL) or an ACL user + key prefix (Redis) per binding | a private instance for this binding only |
| When | most apps, staging, small production apps | heavy or sensitive production workloads |
| Isolation | separate credentials; PostgreSQL databases and Redis prefixes are not visible to other bindings | separate container and data volume |
Create a shared instance
In the panel: Services → Add a service, pick the type and the server. In the desktop app: Services → Add a service. Or:
podmaker service types
podmaker service create postgres-main --type postgresql --server app-01
podmaker service create mysql-main --type mysql --server app-01
podmaker service list
Deploys also create the ones an app needs (you choose: an existing shared one, a new shared one, or one only for that app).
Delete (panel, desktop app, or podmaker service delete NAME) removes the
service and its data. It is refused while apps are connected to it:
disconnect them first.
The instance runs as container imp-svc-<name> on the private imp-services
network. Nothing is published on the server’s ports.
Bind it to an environment
podmaker service bind postgres-main --project shop --env staging --name db
podmaker service bind redis-main --project shop --env staging --name cache
podmaker project bindings shop staging
A dedicated instance for one binding:
podmaker service bind --project shop --env production --name db --isolation dedicated --type postgresql
The environment’s containers join imp-services automatically. Use the
variables in your compose file:
| Type | Variables (defaults) |
|---|---|
| PostgreSQL | DB_CONNECTION=pgsql, DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, DB_PASSWORD, DATABASE_URL |
| Redis | REDIS_HOST, REDIS_PORT, REDIS_USERNAME, REDIS_PASSWORD, REDIS_PREFIX, HORIZON_PREFIX |
services:
app:
image: ${IMP_IMAGE}
environment:
DB_HOST: ${DB_HOST}
DB_DATABASE: ${DB_DATABASE}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
REDIS_HOST: ${REDIS_HOST}
REDIS_USERNAME: ${REDIS_USERNAME}
REDIS_PASSWORD: ${REDIS_PASSWORD}
REDIS_PREFIX: ${REDIS_PREFIX}
Two bindings of the same type in one environment would use the same default variable names. Give the second one its own names with templates, which replace the defaults:
podmaker service bind postgres-main --project shop --env staging --name analytics \
--var ANALYTICS_URL='postgresql://{{username}}:{{password}}@{{host}}:{{port}}/{{database}}'
Placeholders: {{host}}, {{port}}, {{database}}, {{username}},
{{password}}, {{prefix}}. Credentials are stored encrypted. New or
changed bindings take effect at the next deployment.
Redis bindings are restricted by ACL to their key prefix. Configure your
framework to use REDIS_PREFIX; for Laravel Horizon, HORIZON_PREFIX.
Limit: an environment can only bind instances on the same server. Cross-server access over a private network is planned.
Remove a binding
Deleting a binding drops its database or ACL user. It is destructive, so it requires a backup target (PostgreSQL) and an approval:
podmaker service unbind db --project shop --env staging --backup-target offsite
# → a deletion request; approve it in Services or:
podmaker service approve-deletion <deletion-id> # or reject-deletion
A final backup is taken first. The deletion runs only after a human approves it.
Apps on other servers
A shared service can also be used by apps on your other servers, through the encrypted private network. Connect the app as usual. Podmaker opens the service on its server’s private address (never on the internet) and gives the app that address.
Your own services
Every service in the list above is described by a small manifest
(podmaker-service.yml): the container to run, and how to give an app its
own database or user. Your own services (an API, a geo service, a function)
use the same format: see Your own services and functions.
In the panel
Services lists instances with their bindings and health, and the pending deletion and restore requests with Approve / Reject.