Last active
October 23, 2019 10:25
-
-
Save emmanuelbernard/7c530324b8812c820cf85eb7d64ebb70 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --ulimit memlock=-1:-1 -it --rm=true --memory-swappiness=0 --name quarkus-demo -e POSTGRES_USER=quarkus-demo -e POSTGRES_PASSWORD=quarkus-demo -e POSTGRES_DB=quarkus-demo -p 5432:5432 postgres:10.5 | |
## use H2 instead | |
diff --git a/quarkus-workshop-super-heroes/super-heroes/infrastructure/docker-compose.yaml b/quarkus-workshop-super-heroes/super-heroes/infrastructure/docker-compose.yaml | |
index aeeeda3..40f12f4 100644 | |
--- a/quarkus-workshop-super-heroes/super-heroes/infrastructure/docker-compose.yaml | |
+++ b/quarkus-workshop-super-heroes/super-heroes/infrastructure/docker-compose.yaml | |
@@ -7,6 +7,15 @@ services: | |
- "5432:5432" | |
volumes: | |
- ./db-init/initialize-databases.sql:/docker-entrypoint-initdb.d/init.sql | |
+ h2: | |
+ container_name: 'h2' | |
+ hostname: 'h2' | |
+ image: 1000kit/h2 | |
+ ports: | |
+ - "8181:8181" | |
+ - "1521:1521" | |
+ # volumes: | |
+ # - h2-data:/opt/h2-data | |
monitoring: | |
image: "prom/prometheus" | |
diff --git a/quarkus-workshop-super-heroes/super-heroes/rest-hero/pom.xml b/quarkus-workshop-super-heroes/super-heroes/rest-hero/pom.xml | |
index f959807..aaa7e82 100644 | |
--- a/quarkus-workshop-super-heroes/super-heroes/rest-hero/pom.xml | |
+++ b/quarkus-workshop-super-heroes/super-heroes/rest-hero/pom.xml | |
@@ -80,6 +80,10 @@ | |
<groupId>io.quarkus</groupId> | |
<artifactId>quarkus-jdbc-postgresql</artifactId> | |
</dependency> | |
+ <dependency> | |
+ <groupId>io.quarkus</groupId> | |
+ <artifactId>quarkus-jdbc-h2</artifactId> | |
+ </dependency> | |
<!-- end::adocDependencyPostgresql[] --> | |
<!-- tag::adocDependencyValidator[] --> | |
<dependency> | |
diff --git a/quarkus-workshop-super-heroes/super-heroes/rest-hero/src/main/resources/application.properties b/quarkus-workshop-super-heroes/super-heroes/rest-hero/src/main/resources/application.properties | |
index b2c7e35..1ef18d4 100644 | |
--- a/quarkus-workshop-super-heroes/super-heroes/rest-hero/src/main/resources/application.properties | |
+++ b/quarkus-workshop-super-heroes/super-heroes/rest-hero/src/main/resources/application.properties | |
@@ -8,8 +8,10 @@ quarkus.http.cors=true | |
## Database configuration | |
# tag::adocDatasource[] | |
-quarkus.datasource.url=jdbc:postgresql://localhost:5432/heroes_database | |
-quarkus.datasource.driver=org.postgresql.Driver | |
+quarkus.datasource.url=jdbc:h2:tcp://localhost:1521/heroes_database | |
+quarkus.datasource.driver=org.h2.Driver | |
+#quarkus.datasource.url=jdbc:postgresql://localhost:5432/heroes_database | |
+#quarkus.datasource.driver=org.postgresql.Driver | |
quarkus.datasource.username=superman | |
quarkus.datasource.password=superman | |
quarkus.datasource.max-size=8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment