Skip to content

Commit 69ea6e6

Browse files
Docker updates and quick run script (#29)
build: configurable docker container
1 parent 137cf03 commit 69ea6e6

File tree

13 files changed

+80
-0
lines changed

13 files changed

+80
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ This is an example app built using the [Yavin Framework](https://github.com/yavi
1717

1818
## Getting Started
1919

20+
### Quick start (no build required)
21+
Launch demo app using latest yavin-app jar
22+
`curl https://raw.githubusercontent.com/yavin-dev/app/master/yavin-run.sh | bash`
23+
24+
### Pre-requisites for local build
2025
- Install Java 8 or greater (more info [here](https://yavin.dev/pages/guide/02-start.html#prerequisites))
2126
- `git clone https://github.com/yavin-dev/app.git`
2227
- `cd yavin-app`

container/docker/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM verizonmedia/yavin_base:latest
2+
3+
CMD java -jar /usr/local/lib/yavin-app*.jar --spring.profiles.active=LocalFS

container/docker/Dockerfile.base

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM alpine:latest
2+
3+
RUN apk add openjdk11-jdk
4+
RUN apk add nodejs
5+
RUN apk add npm
6+
RUN apk add curl
7+
COPY . /usr/src/yavin
8+
COPY yavin-run.sh /usr/local/bin/
9+
WORKDIR /usr/src/yavin/
10+
RUN ./gradlew build -x test -Penvironment=production
11+
WORKDIR /
12+
RUN cp /usr/src/yavin/ws/build/libs/yavin-app*.jar /usr/local/lib/
13+
RUN rm -rf /usr/src/yavin
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM verizonmedia/yavin_base:latest
2+
3+
CMD java -jar /usr/local/lib/yavin-app*.jar

container/docker/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Yavin Docker Images
2+
Yavin can be easily deployed using docker containers. We maintain multiple dockerfiles for different types of images that can be found on [DockerHub](https://hub.docker.com/repository/docker/verizonmedia/yavin/general).
3+
4+
- **Dockerfile.base:** Alpine Linux based image with all the required Yavin dependencies
5+
- **Dockerfile.demo-config:** Yavin image with demo configuration and dataset
6+
- **Dockerfile**: Production Yavin image with that supports custom configuration
7+
8+
## How To Run Yavin Demo Image
9+
10+
```
11+
docker run -p 9999:8080 verizonmedia/yavin_demo:latest
12+
```
13+
## How To Run Yavin Image With Custom Configuration
14+
15+
```
16+
docker run -v <your path>:/etc/yavin -p 9999:8080 verizonmedia/yavin:latest
17+
```
18+
## Launch in Docker using PWD
19+
20+
[![Click to Launch in Docker instantly](https://raw.githubusercontent.com/play-with-docker/stacks/master/assets/images/button.png)](https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/anupkumangodan/navi/pwd_1/container/docker/docker-compose.yml)
21+
22+
You will be taken to "play with docker" UI where you might have to sign-in (or register first) to continue.
23+
After the initial docker compose and swarm is setup, proceed to click on the port (8080) hyperlink in PWD.
24+
25+
PWD is not production grade platform, so it can show unexpected results. When the above button is clicked and after you sign-in, docker swarm build will start up in a small pop up window. The process will complete in few mins as shown.
26+
27+
![swarm build](images/swarm_build.png)
28+
29+
If the above step completed successfully, click the close button on the popup window.Then you can click (hyperlink) 8080 at the top as shown below.
30+
31+
![ready to open](images/ready_open.png)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: '3.3'
2+
services:
3+
web:
4+
image: docker.io/verizonmedia/yavin_demo:latest
5+
ports:
6+
- '8080:8080'
179 KB
Loading
272 KB
Loading

ws/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ tasks.withType<Test> {
6767
jvmArgs ("-Xmx2048m")
6868
}
6969

70+
7071
val jarName = "yavin-app"
7172
tasks.register<Exec>("execJar") {
7273
dependsOn("bootJar")

ws/src/main/resources/application.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,10 @@ spring:
6262
elide:
6363
async:
6464
cleanupEnabled: false
65+
---
66+
spring:
67+
profiles: LocalFS
68+
elide:
69+
dynamic-config:
70+
enabled: true
71+
path: /etc/yavin

0 commit comments

Comments
 (0)