File tree Expand file tree Collapse file tree 3 files changed +38
-1
lines changed Expand file tree Collapse file tree 3 files changed +38
-1
lines changed Original file line number Diff line number Diff line change
1
+ LABEL authors="cybersokari"
2
+ FROM eclipse-temurin:21 as build
3
+ # GOOGLE_APPLICATION_CREDENTIALS and GCLOUD_PROJECT
4
+ # environment variables are required for a successful
5
+ # AOT compilation process, which starts the app
6
+ # before the compilation.
7
+ ARG PROJECT_ID
8
+ RUN if [ -z "$PROJECT_ID" ]; then \
9
+ echo "PROJECT_ID is required but not set" ; \
10
+ exit 1; \
11
+ fi
12
+ RUN echo "PROJECT_ID is set to $PROJECT_ID"
13
+ ENV GCLOUD_PROJECT=$PROJECT_ID
14
+ ENV GOOGLE_APPLICATION_CREDENTIALS=/gcp/cred.json
15
+
16
+ WORKDIR /app
17
+ # Copy the Google Cloud credentials
18
+ COPY cred.json $GOOGLE_APPLICATION_CREDENTIALS
19
+ # Copy the source code
20
+ COPY .mvn/ .mvn/
21
+ COPY --chmod=0755 mvnw mvnw
22
+ COPY pom.xml .
23
+ COPY ./src src/
24
+ # Download the dependencies and cache them
25
+ RUN ./mvnw dependency:go-offline -DskipTests
26
+ # Build the application
27
+ RUN ./mvnw package -DskipTests
28
+
29
+ # Stage 2: Create the final Docker image
30
+ FROM bellsoft/liberica-openjre-alpine as final
31
+ # Copy the application from the build stage
32
+ COPY --from=build /app/target/web-0.0.1-SNAPSHOT.jar .
33
+ # Command to run the application
34
+ ENTRYPOINT ["java" , "-jar" , "/web-0.0.1-SNAPSHOT.jar" ]
35
+ # Expose the port the application runs on
36
+ EXPOSE 80
Original file line number Diff line number Diff line change
1
+ LABEL authors="cybersokari"
1
2
FROM ghcr.io/graalvm/graalvm-ce:latest as build
2
3
# GOOGLE_APPLICATION_CREDENTIALS and GCLOUD_PROJECT
3
4
# environment variables are required for a successful
Original file line number Diff line number Diff line change 1
- # syntax=docker/dockerfile:1
1
+ LABEL authors= "cybersokari"
2
2
# Dockerfile for running test
3
3
FROM eclipse-temurin:17-jdk-jammy as base
4
4
WORKDIR /build
You can’t perform that action at this time.
0 commit comments