diff --git a/docker/.env b/docker/.env index 1de267cbe7..c433e7f103 100644 --- a/docker/.env +++ b/docker/.env @@ -252,11 +252,21 @@ MG_READER_URL=http://mongodb-reader:9007 MG_THINGS_URL=http://things:9000 MG_USERS_URL=http://users:9002 MG_INVITATIONS_URL=http://invitations:9020 +MG_DOMAINS_URL=http://auth:8189 MG_BOOTSTRAP_URL=http://bootstrap:9013 MG_UI_HOST_URL=http://localhost:9095 MG_UI_VERIFICATION_TLS=false MG_UI_CONTENT_TYPE=application/senml+json MG_UI_INSTANCE_ID= +MG_UI_DB_HOST=ui-db +MG_UI_DB_PORT=5432 +MG_UI_DB_USER=magistrala +MG_UI_DB_PASS=magistrala +MG_UI_DB_NAME=ui +MG_UI_DB_SSL_MODE=disable +MG_UI_DB_SSL_CERT= +MG_UI_DB_SSL_KEY= +MG_UI_DB_SSL_ROOT_CERT= ## Addons Services ### Bootstrap diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 8a54d49ab7..2e501cd887 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -17,6 +17,7 @@ volumes: magistrala-spicedb-db-volume: magistrala-auth-db-volume: magistrala-invitations-db-volume: + magistrala-ui-db-volume: services: spicedb: @@ -707,7 +708,33 @@ services: MG_UI_VERIFICATION_TLS: ${MG_UI_VERIFICATION_TLS} MG_UI_CONTENT_TYPE: ${MG_UI_CONTENT_TYPE} MG_UI_INSTANCE_ID: ${MG_UI_INSTANCE_ID} + MG_UI_DB_HOST: ${MG_UI_DB_HOST} + MG_UI_DB_PORT: ${MG_UI_DB_PORT} + MG_UI_DB_USER: ${MG_UI_DB_USER} + MG_UI_DB_PASS: ${MG_UI_DB_PASS} + MG_UI_DB_NAME: ${MG_UI_DB_NAME} + MG_UI_DB_SSL_MODE: ${MG_UI_DB_SSL_MODE} + MG_UI_DB_SSL_CERT: ${MG_UI_DB_SSL_CERT} + MG_UI_DB_SSL_KEY: ${MG_UI_DB_SSL_KEY} + MG_UI_DB_SSL_ROOT_CERT: ${MG_UI_DB_SSL_ROOT_CERT} ports: - ${MG_UI_PORT}:${MG_UI_PORT} networks: - magistrala-base-net + + ui-db: + image: postgres:16.1-alpine + container_name: magistrala-ui-db + restart: on-failure + command: postgres -c "max_connections=${MG_POSTGRES_MAX_CONNECTIONS}" + environment: + POSTGRES_USER: ${MG_UI_DB_USER} + POSTGRES_PASSWORD: ${MG_UI_DB_PASS} + POSTGRES_DB: ${MG_UI_DB_NAME} + MG_POSTGRES_MAX_CONNECTIONS: ${MG_POSTGRES_MAX_CONNECTIONS} + ports: + - 6007:5432 + networks: + - magistrala-base-net + volumes: + - magistrala-ui-db-volume:/var/lib/postgresql/data