aidboxdb image
this topic explains the configuration and internals of aidboxdb image


aidboxdb image is a custom build of open source PostgreSQL database. Aidbox uses it as data storage. The image can be pulled from HealthSamurai dockerhub.
The aidboxdb image use cases are:
  • To initialize and run a master database for Aidbox to work with
  • To initialize and run a streaming replica of the master database
An open source tool wal-g is used by aidboxdb for continuous archival, backups, and restoration.
aidboxdb image is tagged by PostgreSQL version from which it is built. For example, if you want to use 11.11 PostgreSQL version you should pull healthsamurai/aidboxdb:11.11 image.
Actual supported PostgreSQL versions: 14.2, 13.6​
Available versions: 13.2, 12.6, 11.11​
List of additional installed extensions:
  • pgagent 4.0 - A PostgreSQL job scheduler
  • pg_repack 1.4.7 - Reorganize tables in PostgreSQL databases with minimal locks
  • jsonknife 1.0 - Jsonb extraction tool
  • jsquery 1.1 - Data type for jsonb inspection
The image is configured by supplying environment variables and command line arguments on startup. Keep in mind that you should not change the environment variables once you have initialised the database. The image expects them to be immutable.

Required environment variables

Env variable name
Name of the user that will be created during db initialization
Password for that user
Name of the database to be created on startup
WALG_ variables
Credentials for storage and bucket name for wal-g to use. Refer to the official docs for the details.

Optional environment variables

Env variable name
Path to the postgresql cluster directory in the filesystem. /data by default.
When set to "replica" image proceeds to the streaming replica mode
Name of the replication slot to be created in master database. Should only contain lower case letters, numbers, and the underscore character.
Master database host for streaming replica
When present and PG_ROLE is not set to "replica" starts pgagent daemon on aidboxdb start.
​pgAgent tutorial​
Value ofPOSTGRES_DB variable
Database where pgagent data is stored. If value is set, then database must exist on container start up.
Path to file where pgagent messages are logged
0 error, 1 warning, 2 debug.
If you want to use custom user for pgagent you can specify in this variable.
Value of POSTGRES_PASSWORD variable
Password for custom pgagent user.