mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-26 01:15:50 +00:00
change Dockerfile to build first and run a .jar
This commit is contained in:
parent
33354d2997
commit
78b476fc29
1 changed files with 2 additions and 1 deletions
|
@ -2,6 +2,7 @@ FROM openjdk:18
|
|||
ARG DATABASE
|
||||
WORKDIR app
|
||||
COPY . .
|
||||
RUN /app/mvnw package -DskipTests
|
||||
EXPOSE 8080
|
||||
ENV DATABASE ${DATABASE}
|
||||
CMD sh -c '/app/mvnw spring-boot:run -Dspring-boot.run.profiles=$DATABASE'
|
||||
CMD sh -c 'java -jar /app/target/*.jar -Dspring-boot.run.profiles=$DATABASE'
|
||||
|
|
Loading…
Reference in a new issue