From 119e29af4f845cd6688d7cb4465630b56308577d Mon Sep 17 00:00:00 2001 From: Eric Murphy Date: Thu, 27 Aug 2020 15:39:12 -0400 Subject: [PATCH] Add PostgreSQL --- devfile.yaml | 23 ++++++++++++++++++++++- src/main/resources/application.properties | 8 +++++--- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/devfile.yaml b/devfile.yaml index 35ea5d5..4e82821 100644 --- a/devfile.yaml +++ b/devfile.yaml @@ -48,6 +48,21 @@ components: command: ['tail'] args: ['-f', '/dev/null'] + - memoryLimit: 512Mi + type: dockerimage + volumes: + - name: postgresql-data + containerPath: /var/lib/postgresql/ + image: postgres + alias: postgresql + env: + - value: tradedb + name: POSTGRES_USER + - value: tradedb + name: POSTGRES_PASSWORD + - value: tradedb + name: POSTGRES_DB + commands: - name: Package @@ -98,4 +113,10 @@ commands: "port": 5005 } ] - } \ No newline at end of file + } + - + name: psql + actions: + - type: exec + command: psql -d tradedb -U tradedb + component: postgresql \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index e4de809..0de6dcd 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -4,7 +4,7 @@ quarkus.log.category."io.smallrye.reactive.messaging".level=DEBUG # Quarkus configuration file # key = value quarkus.datasource.driver=org.postgresql.Driver -quarkus.datasource.url=jdbc:postgresql://postgresql:5432/tradedb +quarkus.datasource.url=jdbc:postgresql://postgresql.daytrader:5432/tradedb quarkus.datasource.username=tradedb quarkus.datasource.password=tradedb quarkus.hibernate-orm.database.generation=drop-and-create @@ -13,8 +13,10 @@ quarkus.hibernate-orm.log.sql=true mp.messaging.incoming.orders.connector=smallrye-kafka mp.messaging.incoming.orders.topic=morgan4.inventory.outboxevent -mp.messaging.incoming.orders.bootstrap.servers=morgan4-cluster-kafka-bootstrap:9092 +mp.messaging.incoming.orders.bootstrap.servers=morgan4-cluster-kafka-bootstrap.daytrader:9092 mp.messaging.incoming.orders.group.id=trade-order-service mp.messaging.incoming.orders.key.deserializer=org.apache.kafka.common.serialization.StringDeserializer mp.messaging.incoming.orders.value.deserializer=org.apache.kafka.common.serialization.StringDeserializer -mp.messaging.incoming.orders.max.poll.interval.ms=50000 \ No newline at end of file +mp.messaging.incoming.orders.max.poll.interval.ms=50000 + +%dev.quarkus.datasource.url=jdbc:postgresql://localhost:5432/tradedb \ No newline at end of file