-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
21 lines (20 loc) · 622 Bytes
/
Copy pathDockerfile
File metadata and controls
21 lines (20 loc) · 622 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Use a base image with Java 11
FROM alpine:latest
#install java & mvn
RUN apk add --update openjdk11
RUN apk add --update maven
# Set the working directory
WORKDIR /tmp/build/inputs/app
#copy pom
COPY ./pom.xml ./
#build app
RUN mvn clean package -DskipTests
RUN ls target
RUN chmod -R 777 target/
RUN chmod -R 777 target/demo-0.0.1-SNAPSHOT.jar
# Copy the JAR file to the container
COPY target/demo-0.0.1-SNAPSHOT.jar /opt/demo-app.jar
# Expose the port that your Spring Boot application listens on (default is 8080)
EXPOSE 8080
# Define the command to run your application
CMD ["java", "-jar", "/opt/demo-app.jar"]