Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions cloudbank-v4/customer-helidon/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@

# 1st stage, build the app
FROM container-registry.oracle.com/java/jdk-no-fee-term:21 as build

# Install maven
WORKDIR /usr/share
RUN set -x && \
curl -O https://archive.apache.org/dist/maven/maven-3/3.8.4/binaries/apache-maven-3.8.4-bin.tar.gz && \
tar -xvf apache-maven-*-bin.tar.gz && \
tar -xvf apache-maven-*-bin.tar.gz && \
rm apache-maven-*-bin.tar.gz && \
mv apache-maven-* maven && \
ln -s /usr/share/maven/bin/mvn /bin/

WORKDIR /helidon

# Create a first layer to cache the "Maven World" in the local repository.
# Incremental docker builds will always resume after that, unless you update
# the pom
# Incremental docker builds will always resume after that, unless you update the pom
ADD pom.xml .
RUN mvn package -Dmaven.test.skip -Declipselink.weave.skip -Declipselink.weave.skip -DskipOpenApiGenerate
RUN mvn package -Dmaven.test.skip -Declipselink.weave.skip -DskipOpenApiGenerate

# Do the Maven build!
# Incremental docker builds will resume here when you change sources
ADD src src
RUN mvn package -DskipTests

RUN echo "done!"

# 2nd stage, build the runtime image
FROM container-registry.oracle.com/java/jdk-no-fee-term:21
WORKDIR /helidon

# Copy the binary built in the 1st stage
COPY --from=build /helidon/target/customer-helidon.jar ./
COPY --from=build /helidon/target/libs ./libs
# Copy the dependencies
COPY --from=build /helidon/target/libs ./libs/

# Copy ALL the classes including META-INF directory with config files
COPY --from=build /helidon/target/classes/ ./

# Debug: Show what was copied
RUN ls -la . && echo "=== META-INF contents ===" && ls -la META-INF/ || echo "META-INF not found"

CMD ["java", "-jar", "customer-helidon.jar"]
# Use the correct classpath that includes current directory (.) for classes and META-INF
CMD ["java", "-cp", ".:libs/*", "io.helidon.microprofile.cdi.Main"]

EXPOSE 8080
EXPOSE 8080
5 changes: 5 additions & 0 deletions cloudbank-v4/customer-helidon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
<artifactId>jakarta.persistence-api</artifactId>
<!-- <scope>provided</scope> -->
</dependency>
<dependency>
<groupId>io.helidon.integrations.eureka</groupId>
<artifactId>helidon-integrations-eureka</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.helidon.integrations.cdi</groupId>
<artifactId>helidon-integrations-cdi-jpa</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ javax.sql.DataSource.customer.password = Welcome12345
# Enable Table Creation
hibernate.hbm2ddl.auto=create
hibernate.show_sql=true
hibernate.format_sql=true
hibernate.format_sql=true

# Eureka configuration
server.features.eureka.client.base-uri=http://eureka.eureka:8761/eureka
server.features.eureka.instance.name=helidon-customer-service
server.features.eureka.instance.hostName=helidon.helidon