Skip to content

Commit f7c543d

Browse files
authored
Added docker deployment
1 parent dc9a613 commit f7c543d

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

md/docker.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# docker
2+
3+
Docker is the world’s leading software containerization platform. You can easily run you Jooby app as a docker container. You need to have the docker engine [installed](https://docs.docker.com/engine/installation/).
4+
5+
## usage
6+
7+
You need [docker](https://docs.docker.com/engine/installation/) installed on the building machine.
8+
9+
Add the following to the pom.xml under plugins:
10+
11+
```xml
12+
<plugin>
13+
<groupId>com.spotify</groupId>
14+
<artifactId>docker-maven-plugin</artifactId>
15+
<version>0.4.13</version>
16+
<configuration>
17+
<imageName>my-jooby-image</imageName>
18+
<baseImage>openjdk:jre-alpine</baseImage>
19+
<entryPoint>["java", "-jar", "/${project.build.finalName}.jar"]</entryPoint>
20+
<exposes>
21+
<expose>8080</expose>
22+
</exposes>
23+
<resources>
24+
<resource>
25+
<targetPath>/</targetPath>
26+
<directory>${project.build.directory}</directory>
27+
<include>${project.build.finalName}.jar</include>
28+
</resource>
29+
</resources>
30+
</configuration>
31+
</plugin>
32+
```
33+
34+
In order to create the **docker image** go to your project home, open a terminal and run:
35+
36+
```bash
37+
mvn clean docker:build
38+
```
39+
40+
Once it finish, the docker image will be build and tagged as ```my-jooby-image```.
41+
42+
## run / start
43+
44+
You can now run the image with:
45+
46+
```bash
47+
docker run -p 80:8080 my-jobby-image
48+
```

0 commit comments

Comments
 (0)