This commit is contained in:
Paul Czarkowski 2018-07-26 17:29:03 +00:00 committed by GitHub
commit f33191e63c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 0 deletions

11
Dockerfile Normal file
View file

@ -0,0 +1,11 @@
FROM maven:3.5-jdk-8-alpine
COPY . /src
WORKDIR /src
RUN mvn install
FROM openjdk:8-jre-alpine
WORKDIR /app
EXPOSE 8080
ENV VERSION=2.0.0.BUILD-SNAPSHOT
COPY --from=0 /src/target/spring-petclinic-$VERSION.jar /app/spring-petclinic.jar
CMD ["java", "-jar", "spring-petclinic.jar"]

View file

@ -18,6 +18,20 @@ You can then access petclinic here: http://localhost:8080/
Our issue tracker is available here: https://github.com/spring-projects/spring-petclinic/issues Our issue tracker is available here: https://github.com/spring-projects/spring-petclinic/issues
## Running petclinic with Docker
Included is a multistage `Dockerfile` that will create a relatively small docker image containing Petclinic.
```bash
git clone https://github.com/spring-projects/spring-petclinic.git
cd spring-petclinic
docker build -t spring/petclinic .
docker run -p 8080:8080 spring/petclinic
```
Once started you can browse to http://localhost:8080 to see the Petclinic.
## Database configuration ## Database configuration
In its default configuration, Petclinic uses an in-memory database (HSQLDB) which In its default configuration, Petclinic uses an in-memory database (HSQLDB) which