Configure ADCM to use an external database
ADCM supports operations with external databases. In particular, PostgreSQL databases are supported. If no external database is specified, the built-in SQlite database is used by default.
IMPRORTANT
PostgreSQL database is recommended for use in the product environment. SQLite database is intended for experimental purposes.
|
The prerequisites to use the external PostgreSQL database are:
-
The user, the database, and the user password must be created (
DATABASE_USERNAME
,DATABASE_NAME
,DATABASE_USER_PASSWORD
in the example below). -
The user must be the owner of the external PostgreSQL database.
CREATE USER '<DATABASE_USERNAME>' with encrypted password '<DATABASE_USER_PASSWORD>';
CREATE DATABASE '<DATABASE_NAME>' OWNER '<DATABASE_USERNAME>';
To run ADCM using PostgreSQL as a database, use the following command:
$ sudo docker run -d --restart=always -p 8000:8000 -v /opt/adcm:/adcm/data
-e DB_HOST="<DATABASE_HOSTNAME_OR_IP_ADDRESS>" -e DB_PORT="<DATABASE_TCP_PORT>"
-e DB_USER="<DATABASE_USERNAME>" -e DB_NAME="<DATABASE_NAME>"
-e DB_PASS="<DATABASE_USER_PASSWORD>" --name adcm hub.arenadata.io/adcm/adcm:latest
Use -v /opt/adcm:/adcm/data:Z
for SELinux.