Skip to content

Commit

Permalink
NOISSUE - Add Postgres DB for UI (absmach#2082)
Browse files Browse the repository at this point in the history
Signed-off-by: rodneyosodo <[email protected]>
  • Loading branch information
rodneyosodo authored Feb 15, 2024
1 parent e77d4ea commit a9e5897
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docker/.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 27 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ volumes:
magistrala-spicedb-db-volume:
magistrala-auth-db-volume:
magistrala-invitations-db-volume:
magistrala-ui-db-volume:

services:
spicedb:
Expand Down Expand Up @@ -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

0 comments on commit a9e5897

Please sign in to comment.