|
| 1 | + |
1 | 2 | # Wake on LAN on Steroids for your HomeLab |
2 | 3 |  |
3 | 4 |
|
@@ -222,11 +223,31 @@ In order to **_add our newly created certificate to our Spring Boot application_ |
222 | 223 |
|
223 | 224 | ### Dockerizing our Spring Boot Application |
224 | 225 |
|
225 | | -I was wanting to add a full step-by-step solution on this topic, but let's be honest, there are thousands of tutorials on how to **_dockerize a Spring Boot application_**. |
| 226 | +In order to **containerize and deploy** this tool, with *docker engine installed* you can **create this two files**: |
| 227 | + |
| 228 | +**File**: dockerfile |
| 229 | + |
| 230 | + FROM openjdk:17-jdk-slim |
| 231 | + ARG JAR_FILE=target/*.jar |
| 232 | + COPY ${JAR_FILE} wol.jar |
| 233 | + ENTRYPOINT ["java","-jar","/wol.jar"] |
| 234 | + |
| 235 | +**File**: deploy.sh |
| 236 | + |
| 237 | + docker build -t "wol_api" . |
| 238 | + docker run -d --name "WoL_API" -p 7800:7800/tcp "wol_api" |
226 | 239 |
|
227 | | -Since our app is built in a **self-contained jar file**, we just need to _download our favourite flavour of linux image, expose one port_, and have our app do a **_java -jar wol.jar_** on our container startup. |
| 240 | +Add **permission** to deploy.sh to run it: |
| 241 | + |
| 242 | + sudo chmod 755 deploy.sh |
| 243 | + |
| 244 | +Then just **run** the deploy script: |
| 245 | + |
| 246 | + . deploy.sh |
| 247 | + |
| 248 | + |
228 | 249 |
|
229 | | -[This guide covers **pretty much everything I noted just now.**](https://www.baeldung.com/dockerizing-spring-boot-application) |
| 250 | +You should now have a *running container* called **WoL_API**. |
230 | 251 |
|
231 | 252 | ## Remote Shutdown API Service |
232 | 253 | From version *0.0.8* onwards, this API is compatible with this project **[Remote Shutdown API Service](https://github.com/elModo7/Remote-Shutdown-API)**. |
|
0 commit comments