Skip to content

Commit

Permalink
Merge pull request #23 from vpa1977/petclinic-demo
Browse files Browse the repository at this point in the history
Add spring petclinic demo
  • Loading branch information
vpa1977 authored Feb 16, 2023
2 parents 49689ba + 4e61f97 commit 30e7953
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
37 changes: 37 additions & 0 deletions demos/petclinic/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
ARG PETCLINIC_REPO
ARG PETCLINIC_TAG

ARG BASE_IMAGE=ubuntu/chiselled-jre:8_edge
ARG USER=app
ARG UID=101
ARG GROUP=app
ARG GID=101

FROM eclipse-temurin:8u362-b09-jdk-jammy as builder

ENV PETCLINIC_TAG=${PETCLINIC_TAG:-spring-boot-2.7.3}
ENV PETCLINIC_REPO=${PETCLINIC_REPO:-https://github.com/vpa1977/spring-petclinic}

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y git

RUN git clone --branch $PETCLINIC_TAG $PETCLINIC_REPO

RUN cd spring-petclinic && ./mvnw package

FROM $BASE_IMAGE

ARG USER
ARG UID
ARG GID
USER $UID:$GID

# copy petclinic sample
COPY --chown=$UID:$GID --from=builder \
/spring-petclinic/target/spring-petclinic-2.7.3.jar /

WORKDIR /

ENTRYPOINT ["/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java", \
"-jar", \
"spring-petclinic-2.7.3.jar" ]
11 changes: 11 additions & 0 deletions demos/petclinic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Spring PetClinic

This Dockerfile runs the [Spring PetClinic](https://github.com/spring-projects/spring-petclinic) sample on the `ubuntu/chiselled-jre` container image.

# Running the sample

Execute:

`` docker build -t petclinic . && docker run -p 8080:8080 --tmpfs /tmp:exec petclinic ``

Give it a few minutes to build the sample application and then navigate to http://localhost:8080 to explore the demo.

0 comments on commit 30e7953

Please sign in to comment.