mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 14:55:50 +00:00
set dockerfile back to what lihan had set
This commit is contained in:
parent
4ad3c5ce9a
commit
6b8310bb70
1 changed files with 6 additions and 29 deletions
35
Dockerfile
35
Dockerfile
|
@ -1,37 +1,14 @@
|
||||||
## Use an official OpenJDK runtime as a parent image
|
|
||||||
#FROM openjdk:11-jdk-slim
|
|
||||||
#
|
|
||||||
## Set the working directory inside the container
|
|
||||||
#WORKDIR /app
|
|
||||||
#
|
|
||||||
## Copy the JAR file to the app directory (adjust this path according to your actual JAR file name in the target directory)
|
|
||||||
#COPY target/*.jar app.jar
|
|
||||||
#
|
|
||||||
## Run the jar file
|
|
||||||
#CMD ["java", "-jar", "app.jar"]
|
|
||||||
#
|
|
||||||
## Expose the port the app runs on
|
|
||||||
#EXPOSE 8080
|
|
||||||
|
|
||||||
# Use an official OpenJDK runtime as a parent image
|
# Use an official OpenJDK runtime as a parent image
|
||||||
FROM openjdk
|
FROM openjdk:11-jdk-slim
|
||||||
|
|
||||||
# Set the working directory inside the container
|
# Set the working directory inside the container
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy the Maven wrapper and the pom.xml file
|
# Copy the JAR file to the app directory (adjust this path according to your actual JAR file name in the target directory)
|
||||||
COPY .mvn/ .mvn
|
COPY target/*.jar app.jar
|
||||||
COPY mvnw pom.xml ./
|
|
||||||
|
|
||||||
# Copy the project source code
|
|
||||||
COPY src ./src
|
|
||||||
|
|
||||||
# Package the application
|
|
||||||
RUN ./mvnw clean package
|
|
||||||
|
|
||||||
|
|
||||||
# Copy the JAR file to the app directory
|
|
||||||
RUN cp /app/target/*.jar app.jar
|
|
||||||
|
|
||||||
# Run the jar file
|
# Run the jar file
|
||||||
CMD ["java", "-jar", "app.jar"]
|
CMD ["java", "-jar", "app.jar"]
|
||||||
|
|
||||||
|
# Expose the port the app runs on
|
||||||
|
EXPOSE 8080
|
||||||
|
|
Loading…
Reference in a new issue