From 1164d69b95925562a1d8094b713bc09d8bb69015 Mon Sep 17 00:00:00 2001 From: Alex Prudencio Date: Mon, 5 Aug 2024 17:04:18 -0400 Subject: [PATCH] updated docker --- Dockerfile | 7 +++++-- compose.yaml | 9 +++++++++ src/main/resources/application.properties | 3 ++- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 compose.yaml diff --git a/Dockerfile b/Dockerfile index eb2370e..4f70c5e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ -FROM openjdk:21-jdk-slim +FROM openjdk:21-jdk-buster as build +RUN apt-get install -y git RUN git clone https://git.primefactorsolutions.com/PFS/pfs-recruiting.git RUN cd pfs-recruiting && ./mvnw clean package -Pproduction -COPY target/*.jar app.jar + +FROM build +COPY --from=0 pfs-recruiting/target/*.jar app.jar EXPOSE 8080 ENTRYPOINT ["java", "-jar", "/app.jar"] \ No newline at end of file diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..082858e --- /dev/null +++ b/compose.yaml @@ -0,0 +1,9 @@ +services: + web: + build: . + ports: + - "8080:8080" + volumes: + - myapp:/var/opt/pfs +volumes: + myapp: \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 1f266a2..6298944 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -9,7 +9,8 @@ vaadin.launch-browser=true vaadin.allowed-packages = com.vaadin,org.vaadin,com.primefactorsolutions,com.hilerio.ace,com.flowingcode.vaadin -spring.datasource.url=jdbc:h2:mem:testdb +# spring.datasource.url=jdbc:h2:mem:testdb +spring.datasource.url=jdbc:h2:file:/var/opt/pfs spring.datasource.driverClassName=org.h2.Driver spring.datasource.username=sa spring.datasource.password=sa