-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (33 loc) · 929 Bytes
/
Dockerfile
File metadata and controls
39 lines (33 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# spring-boot-app/Dockerfile
# Start with a base image containing Java runtime
FROM openjdk:17-jdk-alpine
# Set the working directory inside the container
WORKDIR /app
# Copy the built jar file from the local file system to the container
COPY build/libs/*.jar app.jar
# Expose the port the application runs on
EXPOSE 8080
# Command to run the application
ENTRYPOINT ["java", "-jar", "app.jar"]
## Stage 1: Build the Spring Boot application
#FROM gradle:7.3.0-jdk17 AS build
#WORKDIR /app
#COPY . .
#RUN ./gradlew build -x test
#
## Stage 2: Package the application
#FROM openjdk:17-jdk-slim
#WORKDIR /app
#
## Copy the build artifacts from the build stage
#COPY --from=build /app/build/libs/*.jar app.jar
#
#EXPOSE 8080
#
## Copy the docker-build.sh script and set permissions
#COPY ./docker-build.sh .
#RUN chmod +x docker-build.sh
#
#
## Command to run the Spring Boot application
#ENTRYPOINT ["java", "-jar", "app.jar"]