From a56bab7bafddb6de8fe4239c395310f3facc1919 Mon Sep 17 00:00:00 2001 From: Bartosz Date: Thu, 31 Oct 2024 10:31:06 +0100 Subject: [PATCH] add ai-svc to docker-compose --- db/create-onecx-databases.sql | 7 ++++++ docker-compose.yml | 40 ++++++++++++++++++++++++----------- 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/db/create-onecx-databases.sql b/db/create-onecx-databases.sql index 3fbb42c..d6d86b1 100644 --- a/db/create-onecx-databases.sql +++ b/db/create-onecx-databases.sql @@ -12,3 +12,10 @@ DROP DATABASE IF EXISTS "onecx-chat"; CREATE USER onecx_chat WITH PASSWORD 'onecx_chat'; CREATE DATABASE "onecx-chat" WITH OWNER = onecx_chat; +/* +ai-specific part not required if use only onecx-chat-svc +*/ +DROP DATABASE IF EXISTS "onecx-ai"; + DROP ROLE IF EXISTS onecx_ai; + CREATE USER onecx_ai WITH PASSWORD 'onecx_ai'; +CREATE DATABASE "onecx-ai" WITH OWNER = onecx_ai; \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 5aa2f8a..134255e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,8 @@ services: postgresdb: - image: postgres + image: bitnami/postgresql:12 + networks: + - onecx-net environment: POSTGRES_PASSWORD: admin # POSTGRES_DB: postgres @@ -14,26 +16,40 @@ services: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 10s - retries: 5 + retries: 5 onecx-chat-svc: # image: ghcr.io/onecx-apps/onecx-chat-svc:0.0.0-rc.16 image: localhost/onecx-chat-svc:999-SNAPSHOT + networks: + - onecx-net environment: - QUARKUS_DATASOURCE_USERNAME: onecx_chat - QUARKUS_DATASOURCE_PASSWORD: onecx_chat + QUARKUS_DATASOURCE_USERNAME: onecx_chat + QUARKUS_DATASOURCE_PASSWORD: onecx_chat QUARKUS_DATASOURCE_JDBC_URL: "jdbc:postgresql://postgresdb:5432/onecx-chat?sslmode=disable" + QUARKUS_REST_CLIENT_ONECX_AI_SVC_URL: "http://onecx-ai-svc:8080/internal/ai/" + ports: + - "8081:8080" depends_on: postgresdb: condition: service_healthy - -# onecx-ai-svc: -# image: onecx-ai -# ports: -# - "8080:80" - - + onecx-ai-svc: + image: localhost/onecx-ai-quarkus-svc:999-SNAPSHOT + networks: + - onecx-net + environment: + QUARKUS_DATASOURCE_USERNAME: onecx_ai + QUARKUS_DATASOURCE_PASSWORD: onecx_ai + QUARKUS_DATASOURCE_JDBC_URL: "jdbc:postgresql://postgresdb:5432/onecx-ai?sslmode=disable" + ports: + - "8080:8080" + depends_on: + postgresdb: + condition: service_healthy volumes: - postgres: \ No newline at end of file + postgres: +networks: + onecx-net: + driver: bridge