adding a dockerfile and instructions on how to try out the app in a container

This commit is contained in:
Robert Glenn 2018-01-01 20:55:43 -08:00
parent 08024fcc6f
commit 6d31ffc5f7
2 changed files with 31 additions and 0 deletions

24
Dockerfile Normal file
View File

@ -0,0 +1,24 @@
FROM gradle:jdk-alpine
WORKDIR /home/gradle/project
EXPOSE 8080
USER root
RUN apk update
ENV GRADLE_USER_HOME /home/gradle/project
COPY . /home/gradle/project
RUN gradle build
FROM java:jre-alpine
WORKDIR /home/gradle/project
COPY --from=0 /home/gradle/project/build/libs/project-0.0.1-SNAPSHOT.jar .
ENTRYPOINT java -jar project-0.0.1-SNAPSHOT.jar

View File

@ -38,6 +38,13 @@ You need Java installed.
./gradlew bootRun ./gradlew bootRun
open http://localhost:8080 open http://localhost:8080
# Try with [Docker](https://www.docker.com/)
You need Docker installed.
docker build -t spring-boot-realworld-example-app .
docker run -p 8080:8080 -d spring-boot-realworld-example-app
# Run test # Run test
The repository contains a lot of test cases to cover both api test and repository test. The repository contains a lot of test cases to cover both api test and repository test.