commit
1635c21da1
24
Dockerfile
Normal file
24
Dockerfile
Normal 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
|
@ -38,6 +38,12 @@ You need Java installed.
|
|||||||
./gradlew bootRun
|
./gradlew bootRun
|
||||||
open http://localhost:8080
|
open http://localhost:8080
|
||||||
|
|
||||||
|
# Try it out with [Docker](https://www.docker.com/)
|
||||||
|
|
||||||
|
You need Docker installed.
|
||||||
|
|
||||||
|
docker-compose up -d
|
||||||
|
|
||||||
# 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.
|
||||||
|
16
docker-compose.yml
Normal file
16
docker-compose.yml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
spring_boot_realworld_example_app:
|
||||||
|
image: allthethings/spring-boot-realworld-example-app
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: mysql
|
||||||
|
environment:
|
||||||
|
- "MYSQL_ALLOW_EMPTY_PASSWORD=true"
|
||||||
|
ports:
|
||||||
|
- "3306:3306"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user