Skip to content

Commit 4a6ba91

Browse files
committed
update deployment model for Spring Boot example with Open Liberty
1 parent 4fbce46 commit 4a6ba91

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM open-liberty:kernel
2+
COPY server.xml /config/
3+
COPY target/spring-boot-with-open-liberty.jar /config/apps/

spring-boot-with-open-liberty/README.md

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,7 @@ Steps to run this project:
55
1. Clone this Git repository
66
2. Navigate to the folder `spring-boot-with-open-liberty`
77
3. Build the project with `mvn clean package`
8-
4. Download the latest Open Liberty (at least 18.0.0.2) from https://openliberty.io/downloads/ and extract the zip
9-
5. Navigate to the `wlp` folder you extracted and run `bin/server start defaultServer` or `bin/server.bat start defaultServer` for Windows
10-
6. Open the `server.xml` file in `wlp/usr/server/defaultServer` and replace the content with the following configuration:
11-
```
12-
<?xml version="1.0" encoding="UTF-8"?>
13-
<server description="new server">
14-
<featureManager>
15-
<feature>springBoot-2.0</feature>
16-
<feature>servlet-4.0</feature>
17-
<feature>websocket-1.1</feature>
18-
</featureManager>
19-
<httpEndpoint id="defaultHttpEndpoint"
20-
httpPort="9080"
21-
httpsPort="9443" />
22-
<applicationManager autoExpand="true"/>
23-
<springBootApplication location="spring-boot-with-open-liberty.jar"/>
24-
</server>
25-
```
26-
7. Copy the already built (step 3.) `spring-boot-with-open-liberty.jar` to `wlp/usr/server/defaultServer/apps`
27-
8. Visit `http://localhost:9080` for chatting and `http://localhost:9080/api/messages` to get all chat messages
8+
4. Start your Docker daemon
9+
5. Run `docker build -t spring-liberty .`
10+
6. Run `docker run -p 9080:9080 spring-liberty` and wait until the applications successfully booted
11+
7. Visit `http://localhost:9080` for chatting and `http://localhost:9080/api/messages` to get all chat messages
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<server description="new server">
3+
<featureManager>
4+
<feature>springBoot-2.0</feature>
5+
<feature>servlet-4.0</feature>
6+
<feature>websocket-1.1</feature>
7+
</featureManager>
8+
<httpEndpoint id="defaultHttpEndpoint"
9+
httpPort="9080"
10+
httpsPort="9443" />
11+
<applicationManager autoExpand="true"/>
12+
<springBootApplication location="spring-boot-with-open-liberty.jar"/>
13+
</server>

0 commit comments

Comments
 (0)