mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 20:25:50 +00:00
[add] Docker task
This commit is contained in:
parent
c46b19e1a9
commit
856058c92d
2 changed files with 28 additions and 0 deletions
13
Dockerfile
Normal file
13
Dockerfile
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
FROM gradle:8.12-jdk17-focal AS build
|
||||||
|
|
||||||
|
RUN mkdir /project
|
||||||
|
COPY . /project
|
||||||
|
WORKDIR /project
|
||||||
|
RUN gradle clean build
|
||||||
|
|
||||||
|
FROM eclipse-temurin:17.0.14_7-jre-ubi9-minimal
|
||||||
|
|
||||||
|
RUN mkdir /app
|
||||||
|
COPY --from=build /project/build/libs/spring-petclinic-0.1.3-SNAPSHOT.jar /app/java-application.jar
|
||||||
|
WORKDIR /app
|
||||||
|
CMD [ "java", "-jar", "java-application.jar"]
|
15
my-docker-compose.yml
Normal file
15
my-docker-compose.yml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
services:
|
||||||
|
|
||||||
|
petclinic:
|
||||||
|
image: multi-petclinic
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
|
|
||||||
|
postgres:
|
||||||
|
image: postgres:17.0
|
||||||
|
ports:
|
||||||
|
- "5432:5432"
|
||||||
|
environment:
|
||||||
|
- POSTGRES_PASSWORD=petclinic
|
||||||
|
- POSTGRES_USER=petclinic
|
||||||
|
- POSTGRES_DB=petclinic
|
Loading…
Reference in a new issue